diff --git a/ipojo/tests/api/pom.xml b/ipojo/tests/api/pom.xml
deleted file mode 100644
index 1f974e7..0000000
--- a/ipojo/tests/api/pom.xml
+++ /dev/null
@@ -1,127 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <modelVersion>4.0.0</modelVersion>
-
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../pom.xml</relativePath>
-  </parent>
-
-  <groupId>ipojo.tests</groupId>
-  <artifactId>org.apache.felix.ipojo.tests.api</artifactId>
-  <packaging>jar</packaging>
-  <version>${ipojo.api.snapshot}</version>
-  <name>org.apache.felix.ipojo.tests.api</name>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.api</artifactId>
-      <version>${ipojo.api.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>${ipojo.composite.snapshot}</version> <!-- TODO Revert to release once released -->
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-      <version>${ipojo.manipulator.snapshot}</version>
-    </dependency>
-
-    <!-- For external handler management -->
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.handler.whiteboard</artifactId>
-    </dependency>
-
-  <!--
-    Pax Exam API:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam</artifactId>
-    <version>1.1.0</version>
-  </dependency>
-  <!--
-    During runtime Pax Exam will discover the OSGi container to use by
-    searching metadata available into classpath. Pax Exam comes with a
-    default container that uses [Pax Runner] for implementing the
-    container requirements:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-container-default
-    </artifactId>
-    <version>1.1.0</version>
-  </dependency>
-  <!--
-    If your test code is based on JUnit you will have to have the Junit
-    support artifact:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-junit</artifactId>
-    <version>1.1.0</version>
-  </dependency>
-  <dependency>
-    <groupId>junit</groupId>
-    <artifactId>junit</artifactId>
-    <version>4.5</version>
-    <type>jar</type>
-    <scope>test</scope>
-  </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-</project>
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
deleted file mode 100644
index 64cc3ed..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/CompositeTest.java
+++ /dev/null
@@ -1,275 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.not;
-import static org.junit.Assert.assertThat;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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.Factory;
-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;
-import org.apache.felix.ipojo.api.composite.CompositeComponentType;
-import org.apache.felix.ipojo.api.composite.ExportedService;
-import org.apache.felix.ipojo.api.composite.ImportedService;
-import org.apache.felix.ipojo.api.composite.Instance;
-import org.apache.felix.ipojo.api.composite.InstantiatedService;
-import org.example.service.Foo;
-import org.example.service.impl.FooImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-
-@RunWith( JUnit4TestRunner.class )
-public class CompositeTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        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;
-    }
-
-   @Test
-   public void createACompositeWithcontainedInstance() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       PrimitiveComponentType cons = createAConsumer();
-
-       CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("comp1")
-           .addInstance(new Instance(prov.getFactory().getName()))
-           .addInstance(new Instance(cons.getFactory().getName()));
-
-       ComponentInstance ci = type.createInstance();
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
-       // Stop cons
-       cons.stop();
-       assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
-       // Restart cons
-       cons.start();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
-   }
-
-   @Test
-   public void createACompositeWithAnInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       prov.start();
-       PrimitiveComponentType cons = createAConsumer();
-
-       ServiceReference[] refs = osgi.getServiceReferences(Factory.class.getName(),
-               "(component.providedServiceSpecifications=" + Foo.class.getName() +")");
-       assertThat(refs.length, is(not(0)));
-
-       Factory factory = (Factory) osgi.getServiceObject(refs[0]);
-       System.out.println(factory.getComponentDescription().getDescription());
-
-       CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("comp2")
-           .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
-           .addInstance(new Instance(cons.getFactory().getName()));
-
-       ComponentInstance ci = type.createInstance();
-
-       System.out.println(ci.getInstanceDescription().getDescription());
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
-       // Stop prov
-       prov.stop();
-       assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
-       // Restart prov
-       prov.start();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
-   }
-
-   @Test
-   public void createACompositeWithAnOptionalInstantiatedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       prov.start();
-
-       CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("comp3")
-           .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()).setOptional(true));
-
-       ComponentInstance ci = type.createInstance();
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
-       // Stop prov
-       prov.stop();
-       assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));
-
-       // Restart prov
-       prov.start();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
-   }
-
-   @Test
-   public void createACompositeWithAnImportedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       prov.createInstance();
-       PrimitiveComponentType cons = createAConsumer();
-
-       ServiceReference[] refs = osgi.getServiceReferences(Factory.class.getName(),
-               "(component.providedServiceSpecifications=" + Foo.class.getName() +")");
-       assertThat(refs.length, is(not(0)));
-
-       CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("comp2")
-           .addSubService(new ImportedService().setSpecification(Foo.class.getName()))
-           .addInstance(new Instance(cons.getFactory().getName()));
-
-       ComponentInstance ci = type.createInstance();
-
-       System.out.println(ci.getInstanceDescription().getDescription());
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
-       // Stop prov
-       prov.stop();
-       assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-
-       // Restart prov
-       prov.start();
-       prov.createInstance();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
-   }
-
-   @Test
-   public void createACompositeWithAnOptionalImportedService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       prov.createInstance();
-
-       CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("comp3")
-           .addSubService(new ImportedService().setSpecification(Foo.class.getName()).setOptional(true));
-
-       ComponentInstance ci = type.createInstance();
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-
-       // Stop prov
-       prov.stop();
-       assertThat("ci is valid - 1", ci.getState(), is(ComponentInstance.VALID));
-
-       // Restart prov
-       prov.start();
-       prov.createInstance();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-
-   }
-
-   @Test
-   public void createACompositeWithExportingAService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-       // Define the component types
-       PrimitiveComponentType prov = createAProvider();
-       prov.start();
-       PrimitiveComponentType cons = createAConsumer();
-       ComponentInstance c = cons.createInstance();
-
-         CompositeComponentType type = new CompositeComponentType()
-           .setBundleContext(context)
-           .setComponentTypeName("compExport")
-           .addSubService(new InstantiatedService().setSpecification(Foo.class.getName()))
-           .addService(new ExportedService().setSpecification(Foo.class.getName()));
-
-       ComponentInstance ci = type.createInstance();
-
-       assertThat("ci is valid", ci.getState(), is(ComponentInstance.VALID));
-       assertThat("c is valid", c.getState(), is(ComponentInstance.VALID));
-
-
-       // Stop prov
-       prov.stop();
-       assertThat("ci is invalid", ci.getState(), is(ComponentInstance.INVALID));
-       assertThat("c is invalid", c.getState(), is(ComponentInstance.INVALID));
-
-
-       // Restart prov
-       prov.start();
-       assertThat("ci is valid - 2", ci.getState(), is(ComponentInstance.VALID));
-       assertThat("c is valid - 2", c.getState(), is(ComponentInstance.VALID));
-
-
-   }
-
-    private PrimitiveComponentType createAProvider() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(FooImpl.class.getName())
-        .setPublic(true)
-        .addService(new Service()); // Provide the FooService
-    }
-
-    private PrimitiveComponentType createAConsumer() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(org.example.service.impl.MyComponentImpl.class.getName())
-        .addDependency(new Dependency().setField("myFoo"))
-        .setValidateMethod("start");
-    }
-
-
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/ExternalHandlerTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/ExternalHandlerTest.java
deleted file mode 100644
index 9c3dcf7..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/ExternalHandlerTest.java
+++ /dev/null
@@ -1,112 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-import static org.hamcrest.CoreMatchers.is;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertThat;
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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.api.PrimitiveComponentType;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.example.service.impl.HostImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-
-
-
-@RunWith( JUnit4TestRunner.class )
-public class ExternalHandlerTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        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()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.whiteboard").version(asInProject())
-                    )
-                );
-        return opt;
-    }
-
-    @Test
-    public void createAHost() throws Exception {
-        PrimitiveComponentType type = createAWhiteboardHost();
-        ComponentInstance ci = type.createInstance();
-        assertThat (ci.getState(), is (ComponentInstance.VALID));
-        HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
-        assertThat (hd, is (notNullValue()));
-    }
-
-    @Test
-    public void createDoubleHost() throws Exception {
-        PrimitiveComponentType type = createASecondWhiteboardHost();
-        ComponentInstance ci = type.createInstance();
-        assertThat (ci.getState(), is (ComponentInstance.VALID));
-        HandlerDescription hd = ci.getInstanceDescription().getHandlerDescription(Whiteboard.NAMESPACE + ":" + Whiteboard.NAME);
-        assertThat (hd, is (notNullValue()));
-    }
-
-    private PrimitiveComponentType createAWhiteboardHost() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(HostImpl.class.getName())
-        .addHandler(new Whiteboard()
-            .onArrival("arrival")
-            .onDeparture("departure")
-            .setFilter("(foo=foo)")
-         );
-    }
-
-    private PrimitiveComponentType createASecondWhiteboardHost() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(HostImpl.class.getName())
-        .addHandler(new Whiteboard()
-            .onArrival("arrival")
-            .onDeparture("departure")
-            .setFilter("(foo=foo)")
-         )
-         .addHandler(new Whiteboard()
-         .onArrival("arrival")
-         .onDeparture("departure")
-         .setFilter("(foo=bar)")
-         .onModification("modification")
-      );
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/IPOJOHelper.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/IPOJOHelper.java
deleted file mode 100644
index 8943cbe..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/IPOJOHelper.java
+++ /dev/null
@@ -1,730 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.tests.api;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-/**
- * iPOJO Helper.
- * This helper helps getting {@link Factory}, and managing
- * {@link ComponentInstance}.
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class IPOJOHelper {
-
-    /**
-     * The bundle context.
-     */
-    private BundleContext m_context;
-
-
-    /**
-     * List of instances.
-     */
-    private List<ComponentInstance> m_instances;
-
-    /**
-     * Creates a IPOJOHelper.
-     * @param tc the OSGi Test Case
-     */
-    public IPOJOHelper(BundleContext context) {
-        m_context = context;
-        m_instances = new ArrayList<ComponentInstance>();
-    }
-
-    /**
-     * Disposes created instances.
-     * @see org.apache.felix.ipojo.junit4osgi.Helper#dispose()
-     */
-    public void dispose() {
-        for (int i = 0; i < m_instances.size(); i++) {
-            ((ComponentInstance) m_instances.get(i)).dispose();
-        }
-        m_instances.clear();
-    }
-
-    /**
-     * Gets a created instance from the instance name.
-     * @param name the instance name.
-     * @return the created {@link ComponentInstance} or <code>null</code>
-     * if the instance was not created during the session.
-     */
-    public ComponentInstance getInstanceByName(String name) {
-        for (int i = 0; i < m_instances.size(); i++) {
-            if (((ComponentInstance) m_instances.get(i)).getInstanceName()
-                    .equals(name)) {
-                return (ComponentInstance) m_instances.get(i);
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Creates a new component instance with the given name (and empty
-     * configuration), from the factory specified in the given bundle.
-     * 
-     * @param bundle the bundle from which the component factory is defined.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified bundle.
-     * @param instanceName the name of the component instance to create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(Bundle bundle,
-            String factoryName, String instanceName) {
-
-        // Create the instance configuration
-        Properties configuration = new Properties();
-        configuration.put("instance.name", instanceName);
-
-        return createComponentInstance(bundle, factoryName, configuration);
-    }
-
-    /**
-     * Creates a new component instance with the given configuration, from the
-     * factory specified in the given bundle.
-     * 
-     * @param bundle the bundle from which the component factory is defined.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified bundle.
-     * @param configuration the configuration of the component instance to
-     *            create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(Bundle bundle,
-            String factoryName, Dictionary configuration) {
-
-        // Retrieve the component factory.
-        Factory fact = getFactory(bundle, factoryName);
-
-        if (fact == null) {
-            // Factory not found...
-            throw new IllegalArgumentException(
-                    "Cannot find the component factory (" + factoryName
-                            + ") in the specified bundle ("
-                            + bundle.getSymbolicName() + ").");
-        }
-
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration:"
-                            + e.getMessage());
-        }
-    }
-
-    /**
-     * Creates a new component instance with the given name and configuration,
-     * from the factory specified in the given bundle.
-     * 
-     * @param bundle the bundle from which the component factory is defined.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified bundle.
-     * @param instanceName the name of the component instance to create.
-     * @param configuration the configuration of the instance to create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(Bundle bundle,
-            String factoryName, String instanceName, Dictionary configuration) {
-
-        // Add the instance name to the configuration
-        configuration.put("instance.name", instanceName);
-
-        return createComponentInstance(bundle, factoryName, configuration);
-    }
-
-    /**
-     * Creates a new component instance with the given name (and an empty
-     * configuration), from the factory specified in the given service context.
-     * 
-     * @param serviceContext the service context in which the component factory
-     *            service is registered.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified service context.
-     * @param instanceName the name of the component instance to create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(
-            ServiceContext serviceContext, String factoryName,
-            String instanceName) {
-
-        // Create the instance configuration
-        Properties configuration = new Properties();
-        configuration.put("instance.name", instanceName);
-
-        return createComponentInstance(serviceContext, factoryName,
-                configuration);
-    }
-
-    /**
-     * Creates a new component instance with the given name and configuration,
-     * from the factory specified in the given service context.
-     * 
-     * @param serviceContext the service context in which the component factory
-     *            service is registered.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified service context.
-     * @param configuration the configuration of the instance to create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(
-            ServiceContext serviceContext, String factoryName,
-            Dictionary configuration) {
-
-        // Retrieve the component factory.
-        Factory fact = getFactory(serviceContext, factoryName);
-
-        if (fact == null) {
-            // Factory not found...
-            throw new IllegalArgumentException(
-                    "Cannot find the component factory (" + factoryName
-                            + ") in the specified service context.");
-        }
-
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            throw new IllegalArgumentException(
-                    "Cannot create the component instance with the given configuration: "
-                            + e.getMessage());
-        }
-    }
-
-    /**
-     * Creates a new component instance with the given name and configuration,
-     * from the factory specified in the given service context.
-     * 
-     * @param serviceContext the service context in which the component factory
-     *            service is registered.
-     * @param factoryName the name of the component factory, defined in the
-     *            specified service context.
-     * @param instanceName the name of the component instance to create.
-     * @param configuration the configuration of the instance to create.
-     * @return the newly created component instance.
-     */
-    public static ComponentInstance createComponentInstance(
-            ServiceContext serviceContext, String factoryName,
-            String instanceName, Dictionary configuration) {
-
-        // Add the instance name to the configuration
-        configuration.put("instance.name", instanceName);
-
-        return createComponentInstance(serviceContext, factoryName,
-                configuration);
-    }
-
-    /**
-     * Creates a new component instance with the given name (and empty
-     * configuration), from the factory specified in the local bundle.
-     * 
-     * @param factoryName the name of the component factory, defined in the
-     *            local bundle.
-     * @param instanceName the name of the component instance to create.
-     * @return the newly created component instance.
-     */
-    public ComponentInstance createComponentInstance(String factoryName,
-            String instanceName) {
-        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
-                factoryName, instanceName);
-        m_instances.add(ci);
-        return ci;
-    }
-
-    /**
-     * Creates a new component instance with the given configuration, from the
-     * factory specified in the local bundle.
-     * 
-     * @param factoryName the name of the component factory, in the local
-     *            bundle.
-     * @param configuration the configuration of the component instance to
-     *            create.
-     * @return the newly created component instance.
-     */
-    public ComponentInstance createComponentInstance(String factoryName,
-            Dictionary configuration) {
-        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
-                factoryName, configuration);
-        m_instances.add(ci);
-        return ci;
-    }
-
-    /**
-     * Creates a new component instance with no configuration, from the factory
-     * specified in the local bundle.
-     * 
-     * @param factoryName the name of the component factory, in the local
-     *            bundle.
-     * @return the newly created component instance.
-     */
-    public ComponentInstance createComponentInstance(String factoryName) {
-        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
-                factoryName, (Dictionary) null);
-        m_instances.add(ci);
-        return ci;
-    }
-
-    /**
-     * Creates a new component instance with the given name and configuration,
-     * from the factory specified in the given bundle.
-     * 
-     * @param factoryName the name of the component factory, defined in the
-     *            specified bundle.
-     * @param instanceName the name of the component instance to create.
-     * @param configuration the configuration of the instance to create.
-     * @return the newly created component instance.
-     */
-    public ComponentInstance createComponentInstance(String factoryName,
-            String instanceName, Dictionary configuration) {
-        ComponentInstance ci = createComponentInstance(m_context.getBundle(),
-                factoryName, instanceName, configuration);
-        m_instances.add(ci);
-        return ci;
-    }
-
-    /**
-     * Returns the component factory with the given name in the local bundle.
-     * 
-     * @param factoryName the name of the factory to retrieve.
-     * @return the component factory with the given name in the local bundle, or
-     *         {@code null} if not found.
-     */
-    public Factory getFactory(String factoryName) {
-        return getFactory(m_context.getBundle(), factoryName);
-    }
-
-    /**
-     * Returns the handler factory with the given name in the local bundle.
-     * 
-     * @param factoryName the name of the handler factory to retrieve.
-     * @return the handler factory with the given name in the local bundle, or
-     *         {@code null} if not found.
-     */
-    public HandlerFactory getHandlerFactory(String factoryName) {
-        return getHandlerFactory(m_context.getBundle(), factoryName);
-    }
-
-    /**
-     * Returns the metadata description of the component defined in this bundle.
-     * 
-     * @param component the name of the locally defined component.
-     * @return the metadata description of the component with the given name,
-     *         defined in this given bundle, or {@code null} if not found.
-     */
-    public Element getMetadata(String component) {
-        return getMetadata(m_context.getBundle(), component);
-    }
-
-    /**
-     * Returns the component factory with the given name in the given bundle.
-     * 
-     * @param bundle the bundle from which the component factory is defined.
-     * @param factoryName the name of the defined factory.
-     * @return the component factory with the given name in the given bundle, or
-     *         {@code null} if not found.
-     */
-    public static Factory getFactory(Bundle bundle, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            // Retrieves the component factories services in the bundle.
-            refs = bundle.getBundleContext().getServiceReferences(
-                    Factory.class.getName(),
-                    "(factory.name=" + factoryName + ")");
-            if (refs != null) {
-                return (Factory) bundle.getBundleContext().getService(refs[0]);
-            }
-
-            // Factory not found...
-            return null;
-
-        } catch (InvalidSyntaxException e) {
-            throw new IllegalArgumentException(
-                    "Cannot get the component factory services: "
-                            + e.getMessage());
-        }
-    }
-
-    /**
-     * Returns the component factory with the given name, registered in the
-     * given service context.
-     * 
-     * @param serviceContext the service context in which the factory service is
-     *            defined.
-     * @param factoryName the name of the factory.
-     * @return the component factory with the given name, registered in the
-     *         given service context.
-     */
-    public static Factory getFactory(ServiceContext serviceContext,
-            String factoryName) {
-        ServiceReference[] refs;
-        try {
-            // Retrieves the component factories services in the service
-            // context.
-            refs = serviceContext.getServiceReferences(Factory.class.getName(),
-                    "(factory.name=" + factoryName + ")");
-            if (refs != null) {
-                return (Factory) serviceContext.getService(refs[0]);
-            }
-            return null;
-
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : "
-                    + e.getMessage());
-            return null;
-        }
-    }
-
-    /**
-     * Returns the handler factory with the given name in the given bundle.
-     * 
-     * @param bundle the bundle from which the handler factory is defined.
-     * @param factoryName the name of the handler factory to retrieve.
-     * @return the handler factory with the given name in the given bundle, or
-     *         {@code null} if not found.
-     */
-    public static HandlerFactory getHandlerFactory(Bundle bundle,
-            String factoryName) {
-        ServiceReference[] refs;
-        try {
-            // Retrieves the handler factories services in the bundle.
-            refs = bundle.getBundleContext().getServiceReferences(
-                    HandlerFactory.class.getName(),
-                    "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName
-                            + ")");
-            if (refs != null) {
-                return (HandlerFactory) bundle.getBundleContext().getService(
-                        refs[0]);
-            }
-
-            // Factory not found...
-            return null;
-        } catch (InvalidSyntaxException e) {
-            throw new IllegalArgumentException(
-                    "Cannot get the handler factory services: "
-                            + e.getMessage());
-        }
-    }
-
-    /**
-     * Returns the metadata description 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 metadata description of the component with the given name,
-     *         defined in the given bundle, or {@code null} if not found.
-     */
-    public static Element getMetadata(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.
-        try {
-            Element element = ManifestMetadataParser.parseHeaderMetadata(elem);
-            Element[] childs = element.getElements("component");
-            for (int i = 0; i < childs.length; i++) {
-                String name = childs[i].getAttribute("name");
-                String clazz = childs[i].getAttribute("classname");
-                if (name != null && name.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-                if (clazz.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-            }
-
-            // Component not found...
-            return null;
-
-        } 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
-     * service context, offering the specified interface and matching the given
-     * filter.
-     * 
-     * @param serviceContext the service context in which the service is
-     *            searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service object provided by the specified bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public static Object getServiceObject(ServiceContext serviceContext,
-            String itf, String filter) {
-        ServiceReference ref = getServiceReference(serviceContext, itf, filter);
-        if (ref != null) {
-            return serviceContext.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service objects of the services registered in the specified
-     * service context, offering the specified interface and matching the given
-     * filter.
-     * 
-     * @param serviceContext the service context in which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service objects provided by the specified bundle, offering
-     *         the specified interface and matching the given filter.
-     */
-    public static Object[] getServiceObjects(ServiceContext serviceContext,
-            String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(serviceContext, itf,
-                filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = serviceContext.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    /**
-     * Returns the service reference of a service registered in the specified
-     * service context, offering the specified interface and matching the given
-     * filter.
-     * 
-     * @param serviceContext the service context in which services are searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return a service reference registered in the specified service context,
-     *         offering the specified interface and matching the given filter.
-     *         If no service is found, {@code null} is returned.
-     */
-    public static ServiceReference getServiceReference(
-            ServiceContext serviceContext, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(serviceContext, itf,
-                filter);
-        if (refs.length != 0) {
-            return refs[0];
-        } else {
-            // No service found
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service reference of the service registered in the specified
-     * service context, offering the specified interface and having the given
-     * persistent ID.
-     * 
-     * @param serviceContext the service context in which services are searched.
-     * @param itf the interface provided by the searched service.
-     * @param pid the persistent ID of the searched service.
-     * @return a service registered in the specified service context, offering
-     *         the specified interface and having the given persistent ID.
-     */
-    public static ServiceReference getServiceReferenceByPID(
-            ServiceContext serviceContext, String itf, String pid) {
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        ServiceReference[] refs = getServiceReferences(serviceContext, itf,
-                filter);
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            throw new IllegalStateException(
-                    "A service lookup by PID returned several providers ("
-                            + refs.length + ")" + " for " + itf + " with pid="
-                            + pid);
-        }
-    }
-
-    /**
-     * Returns the service reference of all the services registered in the
-     * specified service context, offering the specified interface and matching
-     * the given filter.
-     * 
-     * @param serviceContext the service context in which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return all the service references registered in the specified service
-     *         context, offering the specified interface and matching the given
-     *         filter. If no service matches, an empty array is returned.
-     */
-    public static ServiceReference[] getServiceReferences(
-            ServiceContext serviceContext, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            // Get all the service references
-            refs = serviceContext.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            throw new IllegalArgumentException(
-                    "Cannot get service references: " + e.getMessage());
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    /**
-     * Returns the service reference of a service registered in the specified
-     * service context, offering the specified interface and having the given
-     * name.
-     * 
-     * @param serviceContext the service context in which services are searched.
-     * @param itf the interface provided by the searched service.
-     * @param name the name of the searched service.
-     * @return a service registered in the specified service context, offering
-     *         the specified interface and having the given name.
-     */
-    public static ServiceReference getServiceReferenceByName(
-            ServiceContext serviceContext, String itf, String name) {
-        String filter = null;
-        if (itf.equals(Factory.class.getName())
-                || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        return getServiceReference(serviceContext, itf, filter);
-    }
-
-    /**
-     * Checks the availability of a service inside the given service context.
-     * @param sc the service context
-     * @param itf the service interface to found
-     * @return <code>true</code> if the service is available in the service
-     *         context, <code>false</code> otherwise.
-     */
-    public static boolean isServiceAvailable(ServiceContext sc, String itf) {
-        ServiceReference ref = getServiceReference(sc, itf, null);
-        return ref != null;
-    }
-
-    /**
-     * Checks the availability of a service inside the given service context.
-     * @param sc the service context
-     * @param itf the service interface to found
-     * @param name the service provider name
-     * @return <code>true</code> if the service is available in the service
-     *         context, <code>false</code> otherwise.
-     */
-    public static boolean isServiceAvailableByName(ServiceContext sc,
-            String itf, String name) {
-        ServiceReference ref = getServiceReferenceByName(sc, itf, name);
-        return ref != null;
-    }
-
-    /**
-     * Checks the availability of a service inside the given service context.
-     * @param sc the service context
-     * @param itf the service interface to found
-     * @param pid the pid of the service
-     * @return <code>true</code> if the service is available in the service
-     *         context, <code>false</code> otherwise.
-     */
-    public static boolean isServiceAvailableByPID(ServiceContext sc,
-            String itf, String pid) {
-        ServiceReference ref = getServiceReferenceByPID(sc, itf, pid);
-        return ref != null;
-    }
-
-    /**
-     * Returns the service reference of a service provided by the specified
-     * bundle, offering the specified interface and having the given name.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param name the name of the searched service.
-     * @return a service provided by the specified bundle, offering the
-     *         specified interface and having the given name.
-     */
-    public static ServiceReference getServiceReferenceByName(Bundle bundle,
-            String itf, String name) {
-        String filter = null;
-        if (itf.equals(Factory.class.getName())
-                || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        return OSGiHelper.getServiceReference(bundle, itf, filter);
-    }
-
-    /**
-     * Returns the service reference of a service provided by the local bundle,
-     * offering the specified interface and having the given name.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param name the name of the searched service.
-     * @return a service provided by the specified bundle, offering the
-     *         specified interface and having the given name.
-     */
-    public ServiceReference getServiceReferenceByName(String itf, String name) {
-        return getServiceReferenceByName(m_context.getBundle(), itf, name);
-    }
-
-    /**
-     * Checks if the service is available.
-     * @param itf the service interface
-     * @param name the service provider name
-     * @return <code>true</code> if the service is available, <code>false</code>
-     *         otherwise.
-     */
-    public boolean isServiceAvailableByName(String itf, String name) {
-        ServiceReference ref = getServiceReferenceByName(itf, name);
-        return ref != null;
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/OSGiHelper.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/OSGiHelper.java
deleted file mode 100644
index 7d6e9ad..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/OSGiHelper.java
+++ /dev/null
@@ -1,456 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-import static org.junit.Assert.fail;
-
-
-public class OSGiHelper {
-    
-    /**
-     * The bundle context.
-     */
-    private BundleContext context;
-    
-    /**
-     * List of get references.
-     */
-    private List<ServiceReference> m_references = new ArrayList<ServiceReference>();
-    
-    public OSGiHelper(BundleContext context) {
-        this.context = context;
-    }
-    
-    public void dispose() {
-        // Unget services
-        for (int i = 0; i < m_references.size(); i++) {
-            context.ungetService((ServiceReference) m_references.get(i));
-        }
-        m_references.clear();
-    }
-    
-    /**
-     * Gets the Bundle Context.
-     * @return the bundle context.
-     */
-    public BundleContext getContext() {
-        return context;
-    }
-    
-    /**
-     * Returns the service object of a service provided by the specified bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service object provided by the specified bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public static Object getServiceObject(Bundle bundle, String itf,
-            String filter) {
-        ServiceReference ref = getServiceReference(bundle, itf, filter);
-        if (ref != null) {
-            return bundle.getBundleContext().getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service objects of the services provided by the specified
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service objects provided by the specified bundle, offering
-     *         the specified interface and matching the given filter.
-     */
-    public static Object[] getServiceObjects(Bundle bundle, String itf,
-            String filter) {
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bundle.getBundleContext().getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    /**
-     * Returns the service reference of a service provided by the specified
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return a service reference provided by the specified bundle, offering
-     *         the specified interface and matching the given filter. If no
-     *         service is found, {@code null} is returned.
-     */
-    public static ServiceReference getServiceReference(Bundle bundle,
-            String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs.length != 0) {
-            return refs[0];
-        } else {
-            // No service found
-            return null;
-        }
-    }
-
-    /**
-     * Checks if the service is available.
-     * @param itf the service interface
-     * @return <code>true</code> if the service is available, <code>false</code>
-     *         otherwise.
-     */
-    public boolean isServiceAvailable(String itf) {
-        ServiceReference ref = getServiceReference(itf, null);
-        return ref != null;
-    }
-
-    /**
-     * Checks if the service is available.
-     * @param itf the service interface
-     * @param pid the service pid
-     * @return <code>true</code> if the service is available, <code>false</code>
-     *         otherwise.
-     */
-    public boolean isServiceAvailableByPID(String itf, String pid) {
-        ServiceReference ref = getServiceReferenceByPID(itf, pid);
-        return ref != null;
-    }
-
-    /**
-     * Returns the service reference of the service provided by the specified
-     * bundle, offering the specified interface and having the given persistent
-     * ID.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param pid the persistent ID of the searched service.
-     * @return a service provided by the specified bundle, offering the
-     *         specified interface and having the given persistent ID.
-     */
-    public static ServiceReference getServiceReferenceByPID(Bundle bundle,
-            String itf, String pid) {
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            throw new IllegalStateException(
-                    "A service lookup by PID returned several providers ("
-                            + refs.length + ")" + " for " + itf + " with pid="
-                            + pid);
-        }
-    }
-
-    /**
-     * Returns the service reference of all the services provided in the
-     * specified bundle, offering the specified interface and matching the given
-     * filter.
-     * 
-     * @param bundle the bundle from which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return all the service references provided in the specified bundle,
-     *         offering the specified interface and matching the given filter.
-     *         If no service matches, an empty array is returned.
-     */
-    public static ServiceReference[] getServiceReferences(Bundle bundle,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            // Get all the service references
-            refs = bundle.getBundleContext().getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            throw new IllegalArgumentException(
-                    "Cannot get service references: " + e.getMessage());
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    /**
-     * Returns the service object of a service provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service object provided by the local bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public Object getServiceObject(String itf, String filter) {
-        ServiceReference ref = getServiceReference(itf, filter);
-        if (ref != null) {
-            m_references.add(ref);
-            return context.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service object associated with this service reference.
-     * 
-     * @param ref service reference
-     * @return the service object.
-     */
-    public Object getServiceObject(ServiceReference ref) {
-        if (ref != null) {
-            m_references.add(ref);
-            return context.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service objects of the services provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service objects provided by the local bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public Object[] getServiceObjects(String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                m_references.add(refs[i]);
-                list[i] = context.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    /**
-     * Returns the service reference of a service provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return a service reference provided by the local bundle, offering the
-     *         specified interface and matching the given filter. If no service
-     *         is found, {@code null} is returned.
-     */
-    public ServiceReference getServiceReference(String itf, String filter) {
-        return getServiceReference(context.getBundle(), itf, filter);
-    }
-
-    /**
-     * Returns the service reference of a service provided offering the
-     * specified interface.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @return a service reference provided by the local bundle, offering the
-     *         specified interface and matching the given filter. If no service
-     *         is found, {@code null} is returned.
-     */
-    public ServiceReference getServiceReference(String itf) {
-        return getServiceReference(context.getBundle(), itf, null);
-    }
-
-    /**
-     * Returns the service reference of the service provided by the local
-     * bundle, offering the specified interface and having the given persistent
-     * ID.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param pid the persistent ID of the searched service.
-     * @return a service provided by the local bundle, offering the specified
-     *         interface and having the given persistent ID.
-     */
-    public ServiceReference getServiceReferenceByPID(String itf, String pid) {
-        return getServiceReferenceByPID(context.getBundle(), itf, pid);
-    }
-
-    /**
-     * Returns the service reference of all the services provided in the local
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return all the service references provided in the local bundle, offering
-     *         the specified interface and matching the given filter. If no
-     *         service matches, an empty array is returned.
-     */
-    public ServiceReference[] getServiceReferences(String itf, String filter) {
-        return getServiceReferences(context.getBundle(), itf, filter);
-    }
-    
-    /**
-     * Gets the package admin exposed by the framework.
-     * Fails if the package admin is not available. 
-     * @return the package admin service.
-     */
-    public PackageAdmin getPackageAdmin() {
-        PackageAdmin pa = (PackageAdmin) getServiceObject(PackageAdmin.class.getName(), null);
-        if (pa == null) {
-            fail("No package admin available");
-        }
-        return pa;
-    }
-    
-    /**
-     * Refresh the packages.
-     * Fails if the package admin service is not available.
-     */
-    public void refresh() {
-        getPackageAdmin().refreshPackages(null);
-    }
-    
-    /**
-     * Waits for a service. Fails on timeout.
-     * If timeout is set to 0, it sets the timeout to 10s.
-     * @param itf the service interface
-     * @param filter  the filter
-     * @param timeout the timeout
-     */
-    public void waitForService(String itf, String filter, long timeout) {
-        if (timeout == 0) {
-            timeout = 10000; // Default 10 secondes.
-        }
-        ServiceReference[] refs = getServiceReferences(itf, filter);
-        long begin = System.currentTimeMillis();
-        if (refs.length != 0) {
-            return;
-        } else {
-            while(refs.length == 0) {
-                try {
-                    Thread.sleep(5);
-                } catch (InterruptedException e) {
-                    // Interrupted
-                }
-                long now = System.currentTimeMillis();
-                
-                if ((now - begin) > timeout) {
-                    fail("Timeout ... no services matching with the request after " + timeout + "ms");
-                }
-                refs = getServiceReferences(itf, filter);
-            }
-        }
-    }
-    
-    
-    /**
-     * Installs a bundle.
-     * Fails if the bundle cannot be installed.
-     * Be aware that you have to uninstall the bundle yourself.
-     * @param url bundle url
-     * @return the installed bundle
-     */
-    public Bundle installBundle(String url) {
-        try {
-            return context.installBundle(url);
-        } catch (BundleException e) {
-            fail("Cannot install the bundle " + url + " : " + e.getMessage());
-        }
-        return null; // Can not happen
-    }
-    
-    /**
-     * Installs a bundle.
-     * Fails if the bundle cannot be installed.
-     * Be aware that you have to uninstall the bundle yourself.
-     * @param url bundle url
-     * @param stream input stream containing the bundle
-     * @return the installed bundle
-     */
-    public Bundle installBundle(String url, InputStream stream) {
-        try {
-            return context.installBundle(url, stream);
-        } catch (BundleException e) {
-            fail("Cannot install the bundle " + url + " : " + e.getMessage());
-        }
-        return null; // Can not happen
-    }
-    
-    /**
-     * Installs and starts a bundle.
-     * Fails if the bundle cannot be installed or an error occurs
-     * during startup. Be aware that you have to uninstall the bundle
-     * yourself.
-     * @param url the bundle url
-     * @return the Bundle object.
-     */
-    public Bundle installAndStart(String url) {
-        Bundle bundle = installBundle(url);
-        try {
-            bundle.start();
-        } catch (BundleException e) {
-           fail("Cannot start the bundle " + url + " : " + e.getMessage());
-        }
-        return bundle;
-    }
-    
-    /**
-     * Installs and starts a bundle.
-     * Fails if the bundle cannot be installed or an error occurs
-     * during startup. Be aware that you have to uninstall the bundle
-     * yourself.
-     * @param url the bundle url
-     * @param stream input stream containing the bundle
-     * @return the Bundle object.
-     */
-    public Bundle installAndStart(String url, InputStream stream) {
-        Bundle bundle = installBundle(url, stream);
-        try {
-            bundle.start();
-        } catch (BundleException e) {
-           fail("Cannot start the bundle " + url + " : " + e.getMessage());
-        }
-        return bundle;
-    }
-    
-    /**
-     * Get the bundle by its id.
-     * @param bundleId the bundle id.
-     * @return the bundle with the given id.
-     */
-    public Bundle getBundle(long bundleId) {
-        return context.getBundle(bundleId);
-    }
-    
-    /**
-     * Gets a bundle by its symbolic name.
-     * Fails if no bundle matches.
-     * @param name the symbolic name of the bundle
-     * @return the bundle object.
-     */
-    public Bundle getBundle(String name) {
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            if (name.equals(bundles[i].getSymbolicName())) {
-                return bundles[i];
-            }
-        }
-        fail("No bundles with the given symbolic name " + name);
-        return null; // should not happen
-    }
-
-}
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
deleted file mode 100644
index 469a348..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/PrimitiveComponentTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-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.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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;
-import org.apache.felix.ipojo.api.SingletonComponentType;
-import org.example.service.Foo;
-import org.example.service.impl.FooImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-
-
-@RunWith( JUnit4TestRunner.class )
-public class PrimitiveComponentTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        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() throws Exception {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-
-        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() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-
-        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() throws Exception {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-
-        PrimitiveComponentType type = createAConsumer();
-        ci = type.createInstance();
-        assertThat("Ci is invalid", ci.getState(),
-                is(ComponentInstance.INVALID));
-
-    }
-
-    @Test
-    public void createBoth() throws Exception {
-        ComponentInstance cons = createAConsumer().createInstance();
-        // cons is invalid
-        assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
-        ComponentInstance prov = createAProvider().createInstance();
-        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
-        assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
-
-    }
-
-    @Test
-    public void createTwoCons() throws Exception {
-        ComponentInstance cons1 = createAConsumer().createInstance();
-        // cons is invalid
-        assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-
-        ComponentInstance prov = createAProvider().createInstance();
-        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
-        assertThat("cons is valid", cons1.getState(), is(ComponentInstance.VALID));
-
-        ComponentInstance cons2 = createAnOptionalConsumer().createInstance();
-
-        assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-
-        prov.stop();
-        assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-        assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-    }
-
-    private PrimitiveComponentType createAProvider() {
-        return new PrimitiveComponentType()
-        .setBundleContext(context)
-        .setClassName(FooImpl.class.getName())
-        .addService(new Service()); // Provide the FooService
-    }
-
-    private PrimitiveComponentType createAConsumer() {
-        return new SingletonComponentType()
-        .setBundleContext(context)
-        .setClassName(org.example.service.impl.MyComponentImpl.class.getName())
-        .addDependency(new Dependency().setField("myFoo"))
-        .setValidateMethod("start");
-    }
-
-    private PrimitiveComponentType createAnOptionalConsumer() {
-        return new SingletonComponentType()
-        .setBundleContext(context)
-        .setComponentTypeName("cons.optional")
-        .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/SingletonComponentTest.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java
deleted file mode 100644
index 732fa4d..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/SingletonComponentTest.java
+++ /dev/null
@@ -1,195 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-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;
-import org.apache.felix.ipojo.api.SingletonComponentType;
-import org.example.service.Foo;
-import org.example.service.impl.FooImpl;
-import org.example.service.impl.MyComponentImpl;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import static org.hamcrest.CoreMatchers.*;
-import static org.junit.Assert.assertThat;
-import static org.ops4j.pax.exam.CoreOptions.*;
-import static org.ops4j.pax.exam.MavenUtils.asInProject;
-
-
-@RunWith( JUnit4TestRunner.class )
-public class SingletonComponentTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        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() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException
-    {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-
-        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.disposeInstance(ci);
-
-    }
-
-    @Test
-    public void killTheFactory() throws Exception {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-        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() throws Exception {
-        assertThat( context, is( notNullValue() ) );
-        ComponentInstance ci = null;
-
-        SingletonComponentType type = createAConsumer();
-        ci = type.create();
-        assertThat("Ci is invalid", ci.getState(),
-                is(ComponentInstance.INVALID));
-        type.stop();
-    }
-
-    @Test
-    public void createBoth() throws Exception {
-        SingletonComponentType consFactory = createAConsumer();
-        ComponentInstance cons = consFactory.create();
-        // cons is invalid
-        assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
-        SingletonComponentType provFactory = createAProvider();
-        ComponentInstance prov = provFactory.create();
-        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
-        assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
-        consFactory.stop();
-        provFactory.stop();
-    }
-
-    @Test
-    public void createTwoCons() throws Exception {
-        SingletonComponentType consFactory = createAConsumer();
-        ComponentInstance cons1 = createAConsumer().create();
-        // cons is invalid
-        assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-
-        ComponentInstance prov = createAProvider().create();
-        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
-        assertThat("cons is valid", cons1.getState(), is(ComponentInstance.VALID));
-
-        ComponentInstance cons2 = createAnOptionalConsumer().create();
-
-        assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-
-        prov.stop();
-        assertThat("cons is invalid", cons1.getState(), is(ComponentInstance.INVALID));
-        assertThat("cons2 is valid", cons2.getState(), is(ComponentInstance.VALID));
-    }
-
-    @Test
-    @Ignore // TODO Why is this ignored ?
-    public void setObject() throws Exception {
-        ComponentInstance cons = createAConsumer().setObject(new MyComponentImpl(5)).create();
-        // cons is invalid
-        assertThat("cons is invalid", cons.getState(), is(ComponentInstance.INVALID));
-
-        ComponentInstance prov = createAProvider().create();
-        assertThat("prov is valid", prov.getState(), is(ComponentInstance.VALID));
-        assertThat("cons is valid", cons.getState(), is(ComponentInstance.VALID));
-
-    }
-
-    private SingletonComponentType createAProvider() {
-        PrimitiveComponentType type =  new SingletonComponentType()
-        .setBundleContext(context)
-        .setClassName(FooImpl.class.getName())
-        .addService(new Service()); // Provide the FooService
-
-        return (SingletonComponentType) type;
-    }
-
-    private SingletonComponentType createAConsumer() {
-        PrimitiveComponentType type =  new SingletonComponentType()
-        .setBundleContext(context)
-        .setClassName(org.example.service.impl.MyComponentImpl.class.getName())
-        .setComponentTypeName("singleton.cons")
-        .addDependency(new Dependency().setField("myFoo"))
-        .setValidateMethod("start");
-
-        return (SingletonComponentType) type;
-    }
-
-    private SingletonComponentType createAnOptionalConsumer() {
-        PrimitiveComponentType type =  new SingletonComponentType()
-        .setBundleContext(context)
-        .setClassName(MyComponentImpl.class.getName())
-        .addDependency(new Dependency().setField("myFoo").setOptional(true))
-        .setComponentTypeName("singleton.optional.consumer")
-        .setValidateMethod("start");
-
-        return (SingletonComponentType) type;
-
-    }
-
-
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/Whiteboard.java b/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/Whiteboard.java
deleted file mode 100644
index 17bce48..0000000
--- a/ipojo/tests/api/src/test/java/org/apache/felix/ipojo/tests/api/Whiteboard.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package org.apache.felix.ipojo.tests.api;
-
-import org.apache.felix.ipojo.api.HandlerConfiguration;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-
-public class Whiteboard implements HandlerConfiguration {
-    
-    public static final String NAME = "wbp";
-    
-    public static final String NAMESPACE = "org.apache.felix.ipojo.whiteboard";
-    
-    private String arrival;
-    
-    private String departure;
-    
-    private String modification;
-    
-    private String filter;
-    
-    public Whiteboard onArrival(String method) {
-        arrival = method;
-        return this;
-    }
-    
-    public Whiteboard onDeparture(String method) {
-        departure = method;
-        return this;
-    }
-    
-    public Whiteboard onModification(String method) {
-        modification = method;
-        return this;
-    }
-    
-    public Whiteboard setFilter(String fil) {
-        filter = fil;
-        return this;
-    }
-
-    public Element getElement() {
-        ensureValidity();
-        // Create the root element.
-        Element element = new Element(NAME, NAMESPACE);
-        // Mandatory attributes
-        element.addAttribute(new Attribute("onArrival", arrival));
-        element.addAttribute(new Attribute("onDeparture", departure));
-        element.addAttribute(new Attribute("filter", filter));
-        
-        // Optional attribute
-        if (modification != null) {
-            element.addAttribute(new Attribute("onModification", modification));
-        }        
-        
-        return element;
-    }
-
-    private void ensureValidity() {
-        if (arrival == null) {
-            throw new IllegalStateException("The whiteboard pattern configuration must have a onArrival method");
-        }
-        if (departure == null) {
-            throw new IllegalStateException("The whiteboard pattern configuration must have a onDeparture method");
-        }
-        if (filter == null) {
-            throw new IllegalStateException("The whiteboard pattern configuration must have a filter");
-        }
-        
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/BarService.java b/ipojo/tests/api/src/test/java/org/example/service/BarService.java
deleted file mode 100644
index c00a51d..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/BarService.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.example.service;
-
-public interface BarService {
-    
-    public void doSomethingWithBar();
-    
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/Foo.java b/ipojo/tests/api/src/test/java/org/example/service/Foo.java
deleted file mode 100644
index ea18955..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/Foo.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.example.service;
-
-public interface Foo {
-    
-    
-    public void doSomething();
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/MyService.java b/ipojo/tests/api/src/test/java/org/example/service/MyService.java
deleted file mode 100644
index abf4884..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/MyService.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.example.service;
-
-public interface MyService {
-    double compute(double value);
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/impl/FooImpl.java b/ipojo/tests/api/src/test/java/org/example/service/impl/FooImpl.java
deleted file mode 100644
index 69b2c62..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/impl/FooImpl.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.example.service.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.example.service.Foo;
-
-public class FooImpl implements Foo {
-    
-   // private List<String> m_list = new ArrayList<String>();
-
-    public void doSomething() {
-       // Do something...
-        System.out.println("Hello World !");
-    }
-    
-    public FooImpl(String s) {
-        _setIM(s);
-    }
-    
-    public void _setIM(String s) {
-        
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/impl/HostImpl.java b/ipojo/tests/api/src/test/java/org/example/service/impl/HostImpl.java
deleted file mode 100644
index 1be1a70..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/impl/HostImpl.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.example.service.impl;
-
-import org.osgi.framework.ServiceReference;
-
-public class HostImpl {
-    
-    public void arrival(ServiceReference ref) {
-        
-    }
-    
-    public void departure(ServiceReference ref) {
-        
-    }
-    
-    public void modification(ServiceReference ref) {
-        
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/impl/MyComponentImpl.java b/ipojo/tests/api/src/test/java/org/example/service/impl/MyComponentImpl.java
deleted file mode 100644
index 2bb6ab2..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/impl/MyComponentImpl.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package org.example.service.impl;
-
-import org.example.service.Foo;
-
-public class MyComponentImpl {
-    
-    private Foo myFoo;
-    
-    private int anInt;
-    
-    public MyComponentImpl() {
-        anInt = 2;
-    }
-    
-    public MyComponentImpl(int i) {
-        anInt = i;
-    }
-
-    public void start() {
-       myFoo.doSomething();
-       if (anInt > 0) {
-           System.out.println("Set int to " + anInt);
-       }
-    }
-
-}
diff --git a/ipojo/tests/api/src/test/java/org/example/service/impl/MyServiceImpl.java b/ipojo/tests/api/src/test/java/org/example/service/impl/MyServiceImpl.java
deleted file mode 100644
index efe4c0b..0000000
--- a/ipojo/tests/api/src/test/java/org/example/service/impl/MyServiceImpl.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.example.service.impl;
-
-import org.example.service.MyService;
-
-public class MyServiceImpl implements MyService {
-    public double compute(double value) {
-	return Math.exp(value * Math.cosh(value));
-    }
-}
diff --git a/ipojo/tests/composite/composite-runtime/pom.xml b/ipojo/tests/composite/composite-runtime/pom.xml
deleted file mode 100644
index e8d6b05..0000000
--- a/ipojo/tests/composite/composite-runtime/pom.xml
+++ /dev/null
@@ -1,109 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Composite Test Suite</name>
-  <artifactId>tests.composite</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.composite.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>${ipojo.composite.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.composite.service, org.apache.felix.ipojo.test.composite.component, org.apache.felix.ipojo.test.composite.util
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.composite.*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.composite.CompositeTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java
deleted file mode 100644
index a3bd8df..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/CompositeTestSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.composite.infrastructure.InfrastructureTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class CompositeTestSuite {
-    
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("iPOJO Composites Test Suite", bc);    
-        ots.addTest(InfrastructureTestSuite.suite(bc));
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java
deleted file mode 100644
index 9fcc4fd..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/Baz2CheckProvider.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class Baz2CheckProvider implements CheckService {
-	
-	BazService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int simpleU = 0;
-	int objectU = 0;
-	int refU = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("result", new Boolean(fs.foo()));
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("boolean", new Boolean(fs.getBoolean()));
-		props.put("int", new Integer(fs.getInt()));
-		props.put("long", new Long(fs.getLong()));
-		props.put("double", new Double(fs.getDouble()));
-		if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	private void voidUnbind() {
-		simpleU++;
-	}
-	
-	protected void objectBind(Object o) {
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	protected void objectUnbind(Object o) {
-		if(o != null && o instanceof FooService) { objectU++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	public void refUnbind(ServiceReference sr) {
-		if(sr != null) { refU++; }
-	}
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java
deleted file mode 100644
index fd495e0..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/BazProviderType1.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.BazService;
-
-public class BazProviderType1 implements BazService {
-	
-	private int m_bar;
-	private String m_foo;
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-		p.put("foo", m_foo);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java
deleted file mode 100644
index 2294ba3..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java
deleted file mode 100644
index 9a17f1f..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java
deleted file mode 100644
index 719f235..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooBarProviderType1.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-
-public class FooBarProviderType1 implements FooService, BarService {
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		return new Properties();
-	}
-
-	public boolean bar() {
-		return true;
-	}
-
-	public Properties getProps() {
-		return new Properties();
-	}
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
deleted file mode 100644
index 509e5d1..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderType1.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java
deleted file mode 100644
index ec5261b..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.FooService;
-
-public class FooProviderTypeDyn implements FooService {
-	
-	private int intProp;	
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-
-	public boolean foo() {
-		intProp = 3;
-		boolProp = true;
-		if(strProp.equals("foo")) { strProp = "bar"; }
-		else { strProp = "foo"; }
-		strAProp = new String[] {"foo", "bar", "baz"};
-		intAProp = new int[] {3, 2, 1};
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java
deleted file mode 100644
index 757ae24..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/FooProviderTypeDyn2.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.FooService;
-
-public class FooProviderTypeDyn2 implements FooService {
-	
-	private int intProp = 2;
-	private boolean boolProp = true;
-	private String strProp = "foo";
-	private String[] strAProp = new String[] {"foo", "bar"};
-	private int[] intAProp = new int[] {1, 2, 3};
-
-	public boolean foo() {
-		intAProp = null;
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TataProvider.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TataProvider.java
deleted file mode 100644
index 2607b55..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TataProvider.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.Tata;
-
-
-public class TataProvider implements Tata {
-    
-    int tata = 0;
-    int tataStr = 0;
-    int tataStrs = 0;
-    int tata_2 = 0;
-    int tata_3 = 0;
-    int tata1 = 0;
-    int tata1_1 = 0;
-    int tata5 = 0;
-    int tata5_1 = 0;
-    int tata5_2 = 0;
-    int tataBoolean = 0;
-    int tataBooleans = 0;
-    int tataByte = 0;
-    int tataBytes = 0;
-    private int add;
-    private int tataShorts;
-    private int tataShort;
-    private int tataLongs;
-    private int tataLong;
-    private int tataInts;
-    private int tataInt;
-    private int tataFloat;
-    private int tataFloats;
-    private int tataDoubles;
-    private int tataDouble;
-    private int tataChars;
-    private int tataChar;
-    
-    public Properties getPropsTata() {
-        Properties props = new Properties();
-        props.put("tata", new Integer(tata));
-        props.put("tataStr", new Integer(tataStr));
-        props.put("tataStrs", new Integer(tataStrs));
-        props.put("tata_2", new Integer(tata_2));
-        props.put("tata_3", new Integer(tata_3));
-        props.put("tata1", new Integer(tata1));
-        props.put("tata1_1", new Integer(tata1_1));
-        props.put("tata5", new Integer(tata5));
-        props.put("tata5_1", new Integer(tata5_1));
-        props.put("tata5_2", new Integer(tata5_2));
-        props.put("add", new Integer(add));
-        props.put("tataBoolean", new Integer(tataBoolean));
-        props.put("tataBoolean", new Integer(tataBoolean));
-        props.put("tataByte", new Integer(tataByte));
-        props.put("tataBytes", new Integer(tataBytes));
-        props.put("tataShort", new Integer(tataShort));
-        props.put("tataShorts", new Integer(tataShorts));
-        props.put("tataLongs", new Integer(tataLongs));
-        props.put("tataLong", new Integer(tataLong));
-        props.put("tataInt", new Integer(tataInt));
-        props.put("tataInts", new Integer(tataInts));
-        props.put("tataFloat", new Integer(tataFloat));
-        props.put("tataFloats", new Integer(tataFloats));
-        props.put("tataDouble", new Integer(tataDouble));
-        props.put("tataDoubles", new Integer(tataDoubles));
-        props.put("tataChar", new Integer(tataChar));
-        props.put("tataChars", new Integer(tataChars));
-        return props;
-    }
-
-    public void tata() {
-        tata++;
-    }
-
-    public String tataStr() {
-        tataStr++;
-        return "Tata";
-    }
-
-    public String[] tataStrs() {
-        tataStrs++;
-        return new String[] {"T", "A", "T", "A"};
-    }
-
-    public void tata(int i, int j) {
-        tata_2++;        
-    }
-
-    public void tata(String s) {
-        tata_3++;
-    }
-
-    public String tata1(String a) {
-        tata1++;
-       return a;
-    }
-
-    public String tata1(char[] a) {
-        tata1_1++;
-        String s = new String(a);
-        return s;
-    }
-
-    public String tata5(String a, int i) {
-       tata5++;
-       return a+i;
-    }
-
-    public String tata5(String[] a, int i) {
-       tata5_1++;
-       return ""+a.length + i;
-    }
-
-    public String tata5(String a, int[] i) {
-        tata5_2++;
-        return a + i.length;
-    }
-
-    public boolean tataBoolean(boolean b) {
-        tataBoolean++;
-        return b;
-    }
-
-    public boolean[] tataBooleans(boolean[] b) {
-        tataBooleans++;
-       return b;
-    }
-
-    public byte tataByte(byte b) {
-        tataByte++;
-        return b;
-    }
-
-    public byte[] tataBytes(byte[] b) {
-        tataBytes++;
-        return b;
-    }
-
-    public char tataChar(char c) {
-       tataChar++;
-       return c;
-    }
-
-    public char[] tataChars(char[] c) {
-        tataChars++;
-        return c;
-    }
-
-    public double tataDouble(double d) {
-        tataDouble++;
-        return d;
-    }
-
-    public double[] tataDoubles(double[] d) {
-        tataDoubles++;
-        return d;
-    }
-
-    public float tataFloat(float f) {
-        tataFloat++;
-        return f;
-    }
-
-    public float[] tataFloats(float[] f) {
-        tataFloats++;
-        return f;
-    }
-
-    public int tataInt(int i) {
-        tataInt++;
-        return i;
-    }
-
-    public int[] tataInts(int[] its) {
-        tataInts++;
-        return its;
-    }
-
-    public long tataLong(long l) {
-        tataLong++;
-        return l;
-    }
-
-    public long[] tataLongs(long[] l) {
-        tataLongs++;
-        return l;
-    }
-
-    public short tataShort(short s) {
-        tataShort++;
-        return s;
-    }
-
-    public short[] tataShorts(short[] s) {
-        tataShorts++;
-        return s;
-    }
-
-    public long add(int i, int j, int k) {
-        add++;
-        return i + j + k;
-    }
-
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProvider.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProvider.java
deleted file mode 100644
index fb79bc4..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProvider.java
+++ /dev/null
@@ -1,73 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.Toto;
-
-
-public class TotoProvider implements Toto {
-    
-    private int i = 0;
-    public static int toto = 0;
-    public static int toto_2 = 0;
-    public static int toto_3 = 0;
-    public static int toto_4 = 0;
-    public static int toto1 = 0;
-    
-    public int count() {
-        return i;
-    }
-    
-    public void toto() {
-        toto++;        
-    }
-
-    public void toto(int i, int j) {
-        toto_2++;
-    }
-
-    public String toto(String a) {
-        toto_3++;
-        return a;
-    }
-
-    public String toto(String[] a) {
-        toto_4++;
-        return "toto";
-    }
-
-    public void toto1(String j) {
-        i++;
-        toto1++;        
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("i", new Integer(i));
-        props.put("toto", new Integer(toto));
-        props.put("toto_2", new Integer(toto_2));
-        props.put("toto_3", new Integer(toto_3));
-        props.put("toto_4", new Integer(toto_4));
-        props.put("toto1", new Integer(toto1));
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProviderGlue.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProviderGlue.java
deleted file mode 100644
index 3ea3a88..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/component/TotoProviderGlue.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.Toto;
-
-
-public class TotoProviderGlue implements Toto {
-    
-    Toto m_toto;
-    
-    private int i = 0;
-    public static int toto = 0;
-    public static int toto_2 = 0;
-    public static int toto_3 = 0;
-    public static int toto_4 = 0;
-    public static int toto1 = 0;
-    
-    public int count() {
-        return i;
-    }
-    
-    public void toto() {
-        toto++;
-        m_toto.toto();
-    }
-
-    public void toto(int i, int j) {
-        toto_2++;
-        m_toto.toto(i, j);
-    }
-
-    public String toto(String a) {
-        toto_3++;
-        return a;
-    }
-
-    public String toto(String[] a) {
-        toto_4++;
-        return "toto";
-    }
-
-    public void toto1(String j) {
-        i++;
-        toto1++;
-        m_toto.toto1(j);
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("i", new Integer(i));
-        props.put("gtoto", new Integer(toto));
-        props.put("gtoto_2", new Integer(toto_2));
-        props.put("gtoto_3", new Integer(toto_3));
-        props.put("gtoto_4", new Integer(toto_4));
-        props.put("gtoto1", new Integer(toto1));
-        props.put("glue", "glue");
-        Properties p2 = m_toto.getProps();
-        props.putAll(p2);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
deleted file mode 100644
index ea761db..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/EmptyCompositeTest.java
+++ /dev/null
@@ -1,222 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.infrastructure;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.composite.CompositeInstanceDescription;
-import org.apache.felix.ipojo.composite.CompositeManager;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-
-public class EmptyCompositeTest extends OSGiTestCase {
-	
-	public void testEmptyCompositeCreation() {
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch (Exception e) {
-		    e.printStackTrace();
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		ComponentTypeDescription cd = ci.getFactory().getComponentDescription();
-		assertEquals("Check component type name", cd.getName(), "composite.empty");
-//		assertEquals("Check class name (" + cd.getClassName() + ")", cd.getClassName(), "composite");
-		assertEquals("Check offered service", cd.getprovidedServiceSpecification().length, 0);
-		assertEquals("Check configurable properties", cd.getProperties().length, 0);
-		
-		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state (" + id.getState() + ")", id.getState(), ComponentInstance.VALID);
-		
-		assertEquals("Check contained instance", id.getContainedInstances().length, 0);
-		
-		assertTrue("Check composite manager", ci instanceof CompositeManager);
-		CompositeManager cm = (CompositeManager) ci;
-		ServiceContext sc = cm.getServiceContext();
-		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e.getMessage());
-		}
-		ci.dispose();
-	}
-	
-	public void testInstanceCreation1() {
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		assertTrue("Check composite manager", ci instanceof CompositeManager);
-		CompositeManager cm = (CompositeManager) ci;
-		ServiceContext sc = cm.getServiceContext();
-		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e.getMessage());
-		}
-		
-		Properties props2 = new Properties();
-		props2.put("instance.name","empty2");
-		ComponentInstance ci2 = null;
-		try {
-			ci2 = factory.createComponentInstance(props2, sc);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 1);
-		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];
-		assertEquals("Check composite instance name", id2.getName(), "empty2");
-		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);
-		
-		ci2.dispose();
-		//id = ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 0);
-		
-		ci.dispose();
-	}
-	
-	public void testInstanceCreation2() {
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		assertTrue("Check composite manager", ci instanceof CompositeManager);
-		CompositeManager cm = (CompositeManager) ci;
-		ServiceContext sc = cm.getServiceContext();
-		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e.getMessage());
-		}
-		
-		Factory factory2 = Utils.getFactoryByName(sc, "composite.empty");
-		assertNotNull("Check factory2 not null", factory2);
-		Properties props2 = new Properties();
-		props2.put("instance.name","empty2");
-		ComponentInstance ci2 = null;
-		try {
-			ci2 = factory2.createComponentInstance(props2);
-		} catch(Exception e) {
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 1);
-		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];
-		assertEquals("Check composite instance name", id2.getName(), "empty2");
-		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);
-		
-		ci2.dispose();
-		//id = ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 0);
-		
-		ci.dispose();
-	}
-	
-	public void testInstanceCreation3() {
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		assertTrue("Check composite manager", ci instanceof CompositeManager);
-		CompositeManager cm = (CompositeManager) ci;
-		ServiceContext sc = cm.getServiceContext();
-		try {
-			assertEquals("Check number of factories imported", sc.getServiceReferences(Factory.class.getName(), null).length, getContext().getServiceReferences(Factory.class.getName(), null).length);
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e.getMessage());
-		}
-		
-		Factory factory2 = Utils.getFactoryByName(sc, "composite.empty");
-		assertNotNull("Check factory2 not null", factory2);
-		Properties props2 = new Properties();
-		props2.put("instance.name","empty2");
-		ComponentInstance ci2 = null;
-		try {
-			ci2 = factory2.createComponentInstance(props2, sc);
-		} catch(Exception e) {
-			fail("Unacceptable configuration : " + e.getMessage());
-		}
-		
-		CompositeInstanceDescription id = (CompositeInstanceDescription) ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 1);
-		CompositeInstanceDescription id2 = (CompositeInstanceDescription) id.getContainedInstances()[0];
-		assertEquals("Check composite instance name", id2.getName(), "empty2");
-		assertEquals("Check composite instance state", id2.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id2.getContainedInstances().length, 0);
-		
-		ci2.dispose();
-		//id = ci.getInstanceDescription();
-		assertEquals("Check composite instance name", id.getName(), "empty");
-		assertEquals("Check composite instance state", id.getState(), ComponentInstance.VALID);
-		assertEquals("Check contained instance", id.getContainedInstances().length, 0);
-		
-		ci.dispose();
-	}
-
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
deleted file mode 100644
index 3eebd55..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/FactoryManagementTest.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.infrastructure;
-
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.FactoryStateListener;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-public class FactoryManagementTest extends OSGiTestCase {
-
-	private FakeFactory fake1 = new FakeFactory("fake");
-	private FakeFactory fake2 = new FakeFactory("fake2");
-
-	private Factory emptyFactory;
-	private ComponentInstance empty;
-
-	private class FakeFactory implements Factory {
-
-		private String m_name;
-		public FakeFactory(String name) { m_name = name; }
-
-		public ComponentInstance createComponentInstance(Dictionary arg0) throws UnacceptableConfiguration { return null; }
-		public ComponentInstance createComponentInstance(Dictionary arg0, ServiceContext arg1) throws UnacceptableConfiguration { return null; }
-		public Element getDescription() { return null; }
-		public String getName() { return m_name; }
-		public boolean isAcceptable(Dictionary arg0) { return false; }
-		public void reconfigure(Dictionary arg0) throws UnacceptableConfiguration {	}
-        public void addFactoryStateListener(FactoryStateListener arg0) { }
-        public List getMissingHandlers() { return null;  }
-        public List getRequiredHandlers() { return null;  }
-        public void removeFactoryStateListener(FactoryStateListener arg0) { }
-        public ComponentTypeDescription getComponentDescription() { return null; }
-        public String getClassName() { return ""; }
-        public int getState() { return Factory.VALID; }
-        public BundleContext getBundleContext() { return getContext(); }
-        public String getVersion() { return null;  }
-        public Element getComponentMetadata() { return null; }
-
-    }
-
-	public void setUp() {
-		emptyFactory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty-1");
-		try {
-			empty = emptyFactory.createComponentInstance(props);
-		} catch (Exception e) { fail("Cannot create empty instance " + e.getMessage()); }
-	}
-
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-
-	public void testOneLevelExposition() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		ServiceContext sc = Utils.getServiceContext(empty);
-		ServiceReference[] internalFactoryReferences = Utils.getServiceReferences(sc, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories", parentsFactoryReferences.length, internalFactoryReferences.length);
-
-		for(int i = 0; i < parentsFactoryReferences.length; i++) {
-			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
-			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, internalFactoryReferences, sc));
-		}
-	}
-
-	public void testTwoLevelExposition() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		ServiceContext sc1 = Utils.getServiceContext(empty);
-		ServiceReference[] Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch (Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		ServiceReference[] Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		for(int i = 0; i < Level1FactoryReferences.length; i++) {
-			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
-			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, Level2FactoryReferences, sc2));
-		}
-
-		empty2.dispose();
-	}
-
-	public void testDynamism() {
-		ServiceReference[] parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		ServiceContext sc1 = Utils.getServiceContext(empty);
-		ServiceReference[] Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch (Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		ServiceReference[] Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		for(int i = 0; i < Level1FactoryReferences.length; i++) {
-			Factory factory = (Factory) getContext().getService(parentsFactoryReferences[i]);
-			assertTrue("Check the avaibility of " + factory.getName(), isExposed(factory, Level2FactoryReferences, sc2));
-		}
-
-		// Publish fake1
-		ServiceRegistration reg1 = getContext().registerService(Factory.class.getName(), fake1, null);
-
-		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		sc1 = Utils.getServiceContext(empty);
-		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-		sc2 = Utils.getServiceContext(empty2);
-		Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1.1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		// 	Publish fake2
-		ServiceRegistration reg2 = getContext().registerService(Factory.class.getName(), fake2, null);
-
-		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		sc1 = Utils.getServiceContext(empty);
-		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-		sc2 = Utils.getServiceContext(empty2);
-		Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1.1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		reg1.unregister();
-
-		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		sc1 = Utils.getServiceContext(empty);
-		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-		sc2 = Utils.getServiceContext(empty2);
-		Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1.1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		reg2.unregister();
-
-		parentsFactoryReferences = Utils.getServiceReferences(getContext(), Factory.class.getName(), null);
-		sc1 = Utils.getServiceContext(empty);
-		Level1FactoryReferences = Utils.getServiceReferences(sc1, Factory.class.getName(), null);
-		sc2 = Utils.getServiceContext(empty2);
-		Level2FactoryReferences = Utils.getServiceReferences(sc2, Factory.class.getName(), null);
-
-		assertEquals("Check the number of available factories - 1.1", parentsFactoryReferences.length, Level1FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.2", parentsFactoryReferences.length, Level2FactoryReferences.length);
-		assertEquals("Check the number of available factories - 1.3", Level1FactoryReferences.length, Level2FactoryReferences.length);
-
-		empty2.dispose();
-	}
-
-	public void testInvocation() {
-		ServiceContext sc1 = Utils.getServiceContext(empty);
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch (Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-
-		Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props);
-		} catch (Exception e) { e.printStackTrace(); fail("Cannot instantiate the client : " + e.getMessage()); }
-
-		Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2);
-		} catch (Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		assertNotNull("Check ref existency", ref);
-		CheckService check = (CheckService) sc2.getService(ref);
-
-		assertTrue("Check invocation", check.check());
-		client.dispose();
-		provider.dispose();
-		empty2.dispose();
-	}
-
-
-
-
-	private boolean isExposed(Factory fact, ServiceReference[] refs, ServiceContext sc) {
-		for(int i = 0; i < refs.length; i++) {
-			Factory f = (Factory) sc.getService(refs[i]);
-			if(fact.getName().equals(f.getName())) {
-				sc.ungetService(refs[i]);
-				return true;
-			}
-			sc.ungetService(refs[i]);
-		}
-		return false;
-	}
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/InfrastructureTestSuite.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/InfrastructureTestSuite.java
deleted file mode 100644
index 051ba7b..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/InfrastructureTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.infrastructure;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class InfrastructureTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Service Context Infrastructure Test", bc);
-		ots.addTestSuite(ServiceRegistryTest.class);
-		ots.addTestSuite(EmptyCompositeTest.class);
-		ots.addTestSuite(FactoryManagementTest.class);
-		ots.addTestSuite(ServiceRangeTest.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
deleted file mode 100644
index 54f4648..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRangeTest.java
+++ /dev/null
@@ -1,482 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.infrastructure;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class ServiceRangeTest extends OSGiTestCase {
-	
-	private Factory emptyFactory;
-	private ComponentInstance empty;
-
-	
-	public void setUp() {
-		emptyFactory = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty-1");
-		try {
-			empty = emptyFactory.createComponentInstance(props);
-		} catch(Exception e) { fail("Cannot create empty instance " + e.getMessage()); }
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testLevelOne1() {
-		ServiceContext sc2 = Utils.getServiceContext(empty);
-		
-		Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		// Check visibility 
-		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		provider.dispose();
-		client.dispose();
-		 
-		assertNull("Check foo service invisible inside the composite", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible from the context", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-	}
-	
-	public void testLevelOne2() {
-		ServiceContext sc2 = Utils.getServiceContext(empty);
-		
-		Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props, sc2);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2, sc2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		// Check visibility 
-		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-	}
-	
-	public void testLevelOne3() {
-		ServiceContext sc2 = Utils.getServiceContext(empty);
-		
-		Factory fact1 = Utils.getFactoryByName(getContext(), "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props, sc2);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2, sc2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		// Check visibility 
-		assertNotNull("Check foo service visible inside the composite", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the context", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-	}
-	
-	public void testLevelTwo1() {
-		ServiceContext sc1 = Utils.getServiceContext(empty);		
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-		
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		
-		Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		//	Check visibility 
-		assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		empty2.dispose();
-	}
-	
-	public void testLevelTwo2() {
-		ServiceContext sc1 = Utils.getServiceContext(empty);		
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-		
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		
-		Factory fact1 = Utils.getFactoryByName(sc1, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props, sc2);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(sc1, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2, sc2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		//	Check visibility 
-		assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		empty2.dispose();
-	}
-	
-	public void testLevelTwo3() {
-		ServiceContext sc1 = Utils.getServiceContext(empty);		
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-		
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		
-		Factory fact1 = Utils.getFactoryByName(getContext(), "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props, sc2);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2, sc2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		//	Check visibility 
-		assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		empty2.dispose();
-	}
-	
-	public void testLevelTwo4() {
-		ServiceContext sc1 = Utils.getServiceContext(empty);		
-		Factory fact = Utils.getFactoryByName(sc1, "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty2");
-		ComponentInstance empty2 = null;
-		try {
-			empty2 = fact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate empty2 instance : " + e.getMessage());
-		}
-		
-		ServiceContext sc2 = Utils.getServiceContext(empty2);
-		
-		Factory fact1 = Utils.getFactoryByName(sc2, "COMPO-SimpleCheckServiceProvider");
-		Properties props = new Properties();
-		props.put("instance.name","client");
-		ComponentInstance client = null;
-		try {
-			client = fact1.createComponentInstance(props, sc2);
-		} catch(Exception e) { fail("Cannot instantiate the client : " + e.getMessage()); }
-		
-		Factory fact2 = Utils.getFactoryByName(sc2, "COMPO-FooProviderType-1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","provider");
-		ComponentInstance provider = null;
-		try {
-			provider = fact2.createComponentInstance(props2, sc2);
-		} catch(Exception e) {
-			fail("Cannot instantiate the provider : " + e.getMessage());
-		}
-		
-		ServiceReference ref = sc2.getServiceReference(CheckService.class.getName());
-		CheckService check = (CheckService) sc2.getService(ref);
-		
-		assertTrue("Check invocation", check.check());
-		
-		sc2.ungetService(ref);
-		
-		//	Check visibility 
-		assertNotNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNotNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		// Check invisibilty
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		
-		client.dispose();
-		provider.dispose();
-		 
-		assertNull("Check foo service visible inside the composite 2", sc2.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service visible inside the composite 2", sc2.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the composite 1", sc1.getServiceReference(FooService.class.getName()));
-		assertNull("Check check service invisible inside the composite 1", sc1.getServiceReference(CheckService.class.getName()));
-		assertNull("Check foo service invisible inside the global", getContext().getServiceReference(FooService.class.getName()));
-		try {
-			assertNull("Check check service invisible inside the context", getContext().getServiceReferences(CheckService.class.getName(), "(instance.name=client)"));
-		} catch (InvalidSyntaxException e) {
-			fail("Invalid filter : " + e);
-		}
-		empty2.dispose();
-	}
-	
-	
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
deleted file mode 100644
index 86d96f1..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/infrastructure/ServiceRegistryTest.java
+++ /dev/null
@@ -1,245 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.infrastructure;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.InstanceStateListener;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.context.ServiceRegistry;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceEvent;
-import org.osgi.framework.ServiceListener;
-import org.osgi.framework.ServiceReference;
-import org.osgi.framework.ServiceRegistration;
-
-public class ServiceRegistryTest extends OSGiTestCase {
-	
-	private class svcListener implements ServiceListener {
-		public int registration = 0;
-		public int unregistration = 0;
-		public int modification = 0;
-		public void serviceChanged(ServiceEvent ev) {
-			if(ev.getType() == ServiceEvent.REGISTERED) { registration++; }
-			if(ev.getType() == ServiceEvent.UNREGISTERING) { unregistration++; }
-			if(ev.getType() == ServiceEvent.MODIFIED) { modification++; }
-		}
-	}
-	
-	private class barProvider implements BarService {
-
-		public boolean bar() { return true; }
-
-		public Properties getProps() { return null; }
-
-	}
-	
-	private class FakeComponent implements ComponentInstance {
-
-		public ComponentTypeDescription getComponentDescription() {
-			return null;
-		}
-
-		public BundleContext getContext() {
-			return null;
-		}
-
-		public ComponentFactory getFactory() {
-			return null;
-		}
-
-		public InstanceDescription getInstanceDescription() {
-			return null;
-		}
-
-		public String getInstanceName() {
-			return null;
-		}
-
-		public int getState() {
-			return 0;
-		}
-
-		public boolean isStarted() {
-			return false;
-		}
-
-		public void reconfigure(Dictionary dictionary) { }
-
-		public void start() { }
-
-		public void stop() { }
-		
-		public void dispose() { }
-
-		public void addInstanceStateListener(InstanceStateListener arg0) { }
-
-		public void removeInstanceStateListener(InstanceStateListener arg0) { }
-		
-	}
-	
-	public void testRegistrationAndListener() {
-		ComponentInstance im = new FakeComponent();
-		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(getContext());
-		assertNotNull("Assert registry not null", registry);
-		svcListener all = new svcListener();
-		try {
-			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-		registry.addServiceListener(all);
-		
-		ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), null);
-		
-		try {
-			assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); 
-		 }
-	
-	    ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
-			
-	   try {
-			assertEquals("Check number of registred service", 2, registry.getServiceReferences(null, null).length);
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-	    
-		assertEquals("Check the number of registration", 2, all.registration);
-		
-		Properties props = new Properties();
-		props.put("foo", "bar");
-		reg1.setProperties(props);
-		assertEquals("Check the number of modification", 1, all.modification);
-		
-		reg1.unregister();
-		assertEquals("Check the number of unregistration", 1, all.unregistration);
-		
-		reg2.setProperties(props);
-		assertEquals("Check the number of modification", 2, all.modification);
-		
-		reg2.unregister();
-		assertEquals("Check the number of unregistration", 2, all.unregistration);
-		
-		registry.removeServiceListener(all);
-	}
-	
-	public void testRegistrationAndFilter() {
-		ComponentInstance im = new FakeComponent();
-		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(getContext());
-		svcListener filtered = new svcListener();
-		
-		try {
-			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-		  
-		registry.addServiceListener(filtered, "(foo=bar)");
-		
-		Properties props = new Properties();
-		props.put("foo", "bar");
-		ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
-		
-		try {
-			assertEquals("Check number of registred service", 1, registry.getServiceReferences(null, null).length);
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-		  
-	  ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
-			
-	   try {
-			assertEquals("Check number of registred service", 2, registry.getServiceReferences(null, null).length);
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-			  
-		assertEquals("Check the number of registration", 1, filtered.registration);
-		
-		reg2.setProperties(props);
-		assertEquals("Check the number of modification", 1, filtered.modification);
-		// Follow the OSGi semantics of filters
-		
-		reg1.unregister();
-		reg2.unregister();
-		assertEquals("Check the number of unregistration", 2, filtered.unregistration);
-		registry.removeServiceListener(filtered);
-	}
-	
-	public void testGetService() {
-		ComponentInstance im = new FakeComponent();
-		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(getContext());
-		
-		try {
-			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-		
-		Properties props = new Properties();
-		props.put("foo", "bar");
-		ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
-		
-		ServiceReference ref = registry.getServiceReference(BarService.class.getName());
-		assertNotNull("Check ref not null", ref);
-		assertEquals("Test property", ref.getProperty("foo"), "bar");
-		BarService bar = (BarService) registry.getService(im2, ref);
-		assertTrue("Test invocation", bar.bar());
-		
-		reg1.unregister();
-		ref = registry.getServiceReference(BarService.class.getName());
-		assertNull("Check ref null", ref);
-	}
-	
-	public void testGetFilteredService() {
-		ComponentInstance im = new FakeComponent();
-		ComponentInstance im2 = new FakeComponent();
-		ServiceRegistry registry = new ServiceRegistry(getContext());
-		
-		try {
-			assertNull("Check that there is no available service", registry.getServiceReferences(null, null));
-		} catch (InvalidSyntaxException e) { fail("Cannot query the registry : " + e.getMessage()); }
-		
-		Properties props = new Properties();
-		props.put("foo", "bar");
-		ServiceRegistration reg1 = registry.registerService(im, BarService.class.getName(), new barProvider(), props);
-		ServiceRegistration reg2 = registry.registerService(im2, BarService.class.getName(), new barProvider(), null);
-		
-		ServiceReference[] ref = null;
-		try {
-			ref = registry.getServiceReferences(BarService.class.getName(), "(foo=bar)");
-		} catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
-		assertNotNull("Check ref not null", ref);
-		assertEquals("Check ref count", ref.length, 1);
-		assertEquals("Test property", ref[0].getProperty("foo"), "bar");
-		BarService bar = (BarService) registry.getService(im2, ref[0]);
-		assertTrue("Test invocation", bar.bar());
-		
-		ref = null;
-		reg1.unregister();
-		try {
-			ref = registry.getServiceReferences(BarService.class.getName(), "(bar=foo)");
-		} catch (InvalidSyntaxException e) { fail("Registry query fail : " + e.getMessage()); }
-		assertNull("Check ref null", ref);
-		
-		reg2.unregister();
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/A123/CheckService2.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/A123/CheckService2.java
deleted file mode 100644
index 1a745a9..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/A123/CheckService2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service.A123;
-
-public interface CheckService2 {
-	
-	public boolean check();
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java
deleted file mode 100644
index 8b24f04..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java
deleted file mode 100644
index 88b78a1..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/BazService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface BazService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java
deleted file mode 100644
index 8eb499f..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java
deleted file mode 100644
index bbfa2c9..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tata.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tata.java
deleted file mode 100644
index 04fe33d..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tata.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface Tata {
-    
-    public Properties getPropsTata();
-    
-    public void tata();
-    
-    public int tataInt(int i);
-    public long tataLong(long l);
-    public double tataDouble(double d);
-    public char tataChar(char c);
-    public boolean tataBoolean(boolean b);
-    public short tataShort(short s);
-    public float tataFloat(float f);
-    public byte tataByte(byte b);
-    
-    public int[] tataInts(int[] its);
-    public long[] tataLongs(long[] l);
-    public double[] tataDoubles(double[] d);
-    public char[] tataChars(char[] c);
-    public boolean[] tataBooleans(boolean[] b);
-    public short[] tataShorts(short[] s);
-    public float[] tataFloats(float[] f);
-    public byte[] tataBytes(byte[] b);
-    
-    public String tataStr();
-    public String[] tataStrs();
-    
-    public void tata(int i, int j);
-    public void tata(String s);
-    
-    public String tata1(String a);
-    public String tata1(char[] a);
-    
-    public String tata5(String a, int i);
-    public String tata5(String[] a, int i);
-    public String tata5(String a, int[] i);
-    
-    public long add(int i, int j, int k);
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tota.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tota.java
deleted file mode 100644
index f7481a4..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Tota.java
+++ /dev/null
@@ -1,78 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface Tota {
-    
-    public static final String specification="specification { " +
-    		"requires { " +
-    		    "$specification=\"org.apache.felix.ipojo.test.composite.service.Toto\" " +
-    		    "$optional=\"true\" " +
-    		    "$aggregate=\"true\" " +
-    		    "$type=\"service\" " +
-    		"} }"; 
-    
-    public Properties getProps() throws UnsupportedOperationException;;
-    public Properties getPropsTata();
-    
-    public void tata();
-    
-    public int tataInt(int i);
-    public long tataLong(long l);
-    public double tataDouble(double d);
-    public char tataChar(char c);
-    public boolean tataBoolean(boolean b);
-    public short tataShort(short s);
-    public float tataFloat(float f);
-    public byte tataByte(byte b);
-    
-    public int[] tataInts(int[] its);
-    public long[] tataLongs(long[] l);
-    public double[] tataDoubles(double[] d);
-    public char[] tataChars(char[] c);
-    public boolean[] tataBooleans(boolean[] b);
-    public short[] tataShorts(short[] s);
-    public float[] tataFloats(float[] f);
-    public byte[] tataBytes(byte[] b);
-    
-    public String tataStr();
-    public String[] tataStrs();
-    
-    public void tata(int i, int j);
-    public void tata(String s);
-    
-    public String tata1(String a);
-    public String tata1(char[] a);
-    
-    public String tata5(String a, int i);
-    public String tata5(String[] a, int i);
-    public String tata5(String a, int[] i);
-    
-    public long add(int i, int j, int k);
-    
-    public void toto() throws UnsupportedOperationException;    
-    public void toto(int i, int j) throws UnsupportedOperationException;
-    public String toto(String a) throws UnsupportedOperationException;
-    
-    public void toto1(String j) throws UnsupportedOperationException;
-    
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Toto.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Toto.java
deleted file mode 100644
index edf6c10..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/service/Toto.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.service;
-
-import java.util.Properties;
-
-public interface Toto {
-    
-    public Properties getProps();
-    
-    public void toto();    
-    public void toto(int i, int j);
-    public String toto(String a);
-    public String toto(String[] a);
-    
-    public void toto1(String j);
-    
-    public int count();
-
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/util/Utils.java b/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/util/Utils.java
deleted file mode 100644
index 89f094f..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/java/org/apache/felix/ipojo/test/composite/util/Utils.java
+++ /dev/null
@@ -1,291 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    public static ServiceContext getServiceContext(ComponentInstance ci) {
-        if (ci instanceof CompositeManager) {
-            return ((CompositeManager) ci).getServiceContext();
-        } else {
-            throw new RuntimeException("Cannot get the service context from a non composite instance");
-        }
-    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-}
diff --git a/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml b/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml
deleted file mode 100644
index b7c2ad2..0000000
--- a/ipojo/tests/composite/composite-runtime/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd
-	    org.apache.felix.composite http://felix.apache.org/ipojo/schemas/SNAPSHOT/composite.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:comp="org.apache.felix.ipojo.composite"
-	xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
-	<!-- Used component type -->
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
-		name="COMPO-FooProviderType-1" architecture="true">
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooProviderType1"
-		name="COMPO-FooProviderType-2" architecture="true">
-		<provides>
-			<property name="int" type="int" value="2" />
-			<property name="long" type="long" value="40" />
-			<property name="string" type="java.lang.String" value="foo" />
-			<property name="strAProp" type="java.lang.String[]"
-				value="{foo, bar}" />
-			<property name="intAProp" type="int[]" value="{1,2,3}" />
-		</provides>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn"
-		name="COMPO-FooProviderType-Dyn" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="2" />
-			<property name="boolean" field="boolProp" value="false" />
-			<property name="string" field="strProp" value="foo" />
-			<property name="strAProp" field="strAProp"
-				value="{foo, bar}" />
-			<property name="intAProp" field="intAProp" value="{ 1,2,3}" />
-		</provides>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooProviderTypeDyn2"
-		name="COMPO-FooProviderType-Dyn2" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="4" />
-			<property name="boolean" field="boolProp" />
-			<property name="string" field="strProp" />
-			<property name="strAProp" field="strAProp" />
-			<property name="intAProp" field="intAProp"
-				value="{1, 2,3 }" />
-		</provides>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.CheckServiceProvider"
-		name="COMPO-SimpleCheckServiceProvider" architecture="true">
-		<requires field="fs" />
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
-		name="COMPO-FooBarProviderType-1" architecture="true">
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
-		name="COMPO-FooBarProviderType-2" architecture="true">
-		<provides
-			specifications="{org.apache.felix.ipojo.test.composite.service.FooService, org.apache.felix.ipojo.test.composite.service.BarService }" />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.FooBarProviderType1"
-		name="COMPO-FooBarProviderType-3" architecture="true">
-		<provides
-			specifications="{org.apache.felix.ipojo.test.composite.service.FooService}">
-			<property name="baz" type="java.lang.String" value="foo" />
-		</provides>
-		<provides
-			specifications="{org.apache.felix.ipojo.test.composite.service.BarService}">
-			<property name="baz" type="java.lang.String" value="bar" />
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.BazProviderType1"
-		name="BazProviderType">
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.TataProvider"
-		name="tata">
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.TotoProvider"
-		name="toto" architecture="true">
-		<provides />
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.composite.component.TotoProviderGlue"
-		name="totoglue">
-		<requires field="m_toto" scope="composite" />
-	</component>
-
-	<!--  Composite -->
-	<comp:composite name="composite.empty" architecture="true">
-	</comp:composite>
-
-	<component classname="org.apache.felix.ipojo.test.composite.component.Baz2CheckProvider" name="Baz2CheckProvider" architecture="true">
-		<requires field="fs" scope="composite"/>
-		<provides/>
-	</component>
-
-</ipojo>
diff --git a/ipojo/tests/composite/import-export/pom.xml b/ipojo/tests/composite/import-export/pom.xml
deleted file mode 100644
index 388c180..0000000
--- a/ipojo/tests/composite/import-export/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Composite (Service Import/Export) Test Suite</name>
-  <artifactId>tests.composite.service.import-export</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.composite.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>${ipojo.composite.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.composite</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.composite.exporter, org.apache.felix.ipojo.test.composite.importer
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.composite.importer.ImportTestSuite, org.apache.felix.ipojo.test.composite.exporter.ExportTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/ExportTestSuite.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/ExportTestSuite.java
deleted file mode 100644
index d9b84f1..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/ExportTestSuite.java
+++ /dev/null
@@ -1,40 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ExportTestSuite extends TestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Composite Service Exporters Test Suite", bc);
-		ots.addTestSuite(SimpleExport.class);
-		ots.addTestSuite(OptionalExport.class);
-		ots.addTestSuite(MultipleExport.class);
-		ots.addTestSuite(OptionalMultipleExport.class);
-		ots.addTestSuite(FilteredExport.class);
-		ots.setBundleContext(bc);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
deleted file mode 100644
index a60b711..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/FilteredExport.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class FilteredExport extends OSGiTestCase {
-	
-	ComponentInstance export1;
-	Factory fooProvider;
-	ComponentInstance foo1 = null, foo2 = null;
-	
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to create foos : " + e.getMessage());
-		}
-		
-		foo1.stop();
-		foo2.stop();
-		
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.5");
-		Properties props = new Properties();
-		props.put("instance.name","export");
-		try {
-			export1 = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Fail to instantiate exporter " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		export1.dispose();
-		foo1 = null;
-		foo2 = null;
-		export1 = null;
-	}
-	
-	public void test1() {
-		export1.start();
-		
-		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 3", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 4", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check invalidity - 5", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 0);
-	}
-	
-	public void test2() {
-		export1.start();
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 4", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 5", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke());
-	}
-	
-	public void test3() {
-		foo1.start();
-		foo2.start();
-		
-		export1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 2", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 0);
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 3", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 4", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke());
-	}
-	
-	public void test4() {
-		foo1.start();
-		foo2.start();
-		
-		export1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 3", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check invalidity - 4", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-	}
-	
-	
-	
-	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
-		return ref != null;
-	}
-	
-	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
-		return refs.length;
-	}
-	
-	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
-		if(ref == null) { return false; }
-		BazService fs = (BazService) getContext().getService(ref);
-		return fs.foo();
-	}
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
deleted file mode 100644
index 7d452d0..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/MultipleExport.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MultipleExport extends OSGiTestCase {
-	
-	ComponentInstance export3;
-	Factory fooProvider;
-	ComponentInstance foo1 = null, foo2 = null;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to create foos : " + e.getMessage());
-		}
-		
-		foo1.stop();
-		foo2.stop();
-		
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.3");
-		Properties props = new Properties();
-		props.put("instance.name","export");
-		try {
-			export3 = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Fail to instantiate exporter " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		export3.dispose();
-		foo1 = null;
-		foo2 = null;
-		export3 = null;
-	}
-	
-	public void test1() {
-		export3.start();
-		
-		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke(1));
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 2", invoke(2));
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3 ("+countFooServiceProvided()+")", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke(1));
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 4", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 5", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke(1));
-	}
-	
-	public void test2() {
-		export3.start();
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 2", invoke(2));
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke(1));
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 4", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 5", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke(1));
-	}
-	
-	public void test3() {
-		foo1.start();
-		foo2.start();
-		
-		export3.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 1", invoke(2));
-		
-		foo1.stop();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke(1));
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 3", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke(1));
-	}
-	
-	public void test4() {
-		foo1.start();
-		foo2.start();
-		
-		export3.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 1", invoke(2));
-		
-		foo2.stop();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke(1));
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 3", export3.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke(1));
-	}
-	
-	
-	
-	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
-		return ref != null;
-	}
-	
-	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
-		return refs.length;
-	}
-	
-	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
-		if(ref == null) { return false; }
-		BazService fs = (BazService) getContext().getService(ref);
-		getContext().ungetService(ref);
-		return fs.foo();
-	}
-	
-	private boolean invoke(int nb) {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
-		if(refs == null) { return false; }
-		if (nb > refs.length) { return false; }
-		for(int i = 0; i < nb; i++) {
-			BazService fs = (BazService) getContext().getService(refs[i]);
-			getContext().ungetService(refs[i]);
-			if(!fs.foo()) { return false; }
-		}
-		return true;
-	}
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
deleted file mode 100644
index 3879abe..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalExport.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class OptionalExport extends OSGiTestCase {
-	
-	ComponentInstance export2;
-	Factory fooProvider;
-	ComponentInstance foo1 = null, foo2 = null;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to create foos : " + e.getMessage());
-		}
-		
-		foo1.stop();
-		foo2.stop();
-		
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.2");
-		Properties props = new Properties();
-		props.put("instance.name","export");
-		try {
-			export2 = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Fail to instantiate exporter " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		export2.dispose();
-		foo1 = null;
-		foo2 = null;
-		export2 = null;
-	}
-	
-	public void test1() {
-		export2.start();
-		
-		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
-		
-		// Test validity
-		assertTrue("Check validity - 0", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3 ("+countFooServiceProvided()+")", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 4", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 5", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke());
-	}
-	
-	public void test2() {
-		export2.start();
-		
-		// Test invalidity
-		assertTrue("Check validity - 0", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 4", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 5", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke());
-	}
-	
-	public void test3() {
-		foo1.start();
-		foo2.start();
-		
-		export2.start();
-		assertTrue("Check validity - 1", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 2", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 4", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke());
-	}
-	
-	public void test4() {
-		foo1.start();
-		foo2.start();
-		
-		export2.start();
-		assertTrue("Check validity - 1", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 2", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export2.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 4", export2.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke());
-	}
-	
-	
-	
-	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export2.getInstanceName());
-		return ref != null;
-	}
-	
-	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export2.getInstanceName()+")");
-		return refs.length;
-	}
-	
-	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export2.getInstanceName());
-		if(ref == null) { return false; }
-		BazService fs = (BazService) getContext().getService(ref);
-		return fs.foo();
-	}
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
deleted file mode 100644
index 9c38800..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/OptionalMultipleExport.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class OptionalMultipleExport extends OSGiTestCase {
-	
-	ComponentInstance export3;
-	Factory fooProvider;
-	ComponentInstance foo1 = null, foo2 = null;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to create foos : " + e.getMessage());
-		}
-		
-		foo1.stop();
-		foo2.stop();
-		
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.4");
-		Properties props = new Properties();
-		props.put("instance.name","export");
-		try {
-			export3 = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Fail to instantiate exporter " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		export3.dispose();
-		foo1 = null;
-		foo2 = null;
-		export3 = null;
-	}
-	
-	public void test1() {
-		export3.start();
-		
-		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
-		
-		// Test invalidity
-		assertTrue("Check validity - 0", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke(1));
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 2", invoke(2));
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3 ("+countFooServiceProvided()+")", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke(1));
-		
-		foo2.stop();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 5", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke(1));
-	}
-	
-	public void test2() {
-		export3.start();
-		
-		// Test invalidity
-		assertTrue("Check validity - 0", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 2", invoke(2));
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke(1));
-		
-		foo1.stop();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 5", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke(1));
-	}
-	
-	public void test3() {
-		foo1.start();
-		foo2.start();
-		
-		export3.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 1", invoke(2));
-		
-		foo1.stop();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke(1));
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke(1));
-	}
-	
-	public void test4() {
-		foo1.start();
-		foo2.start();
-		
-		export3.start();
-		assertTrue("Check validity - 1", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 2);
-		assertTrue("Check invocation - 1", invoke(2));
-		
-		foo2.stop();
-		assertTrue("Check validity - 2", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke(1));
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export3.getState() == ComponentInstance.VALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 4", export3.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke(1));
-	}
-	
-	
-	
-	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
-		return ref != null;
-	}
-	
-	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
-		return refs.length;
-	}
-	
-	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export3.getInstanceName());
-		if(ref == null) { return false; }
-		BazService fs = (BazService) getContext().getService(ref);
-		getContext().ungetService(ref);
-		return fs.foo();
-	}
-	
-	private boolean invoke(int nb) {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export3.getInstanceName()+")");
-		if(refs == null) { return false; }
-		if (nb > refs.length) { return false; }
-		for(int i = 0; i < nb; i++) {
-			BazService fs = (BazService) getContext().getService(refs[i]);
-			getContext().ungetService(refs[i]);
-			if(!fs.foo()) { return false; }
-		}
-		return true;
-	}
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
deleted file mode 100644
index 54418e6..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/exporter/SimpleExport.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.exporter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleExport extends OSGiTestCase {
-	
-	ComponentInstance export1;
-	Factory fooProvider;
-	ComponentInstance foo1 = null, foo2 = null;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "BazProviderType");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to create foos : " + e.getMessage());
-		}
-		
-		foo1.stop();
-		foo2.stop();
-		
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.export.1");
-		Properties props = new Properties();
-		props.put("instance.name","export");
-		try {
-			export1 = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Fail to instantiate exporter " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		export1.dispose();
-		foo1 = null;
-		foo2 = null;
-		export1 = null;
-	}
-	
-	public void test1() {
-		export1.start();
-		
-		// Check that no foo service are available
-		assertEquals("Check no foo service", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 0);
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 3", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3 ("+countFooServiceProvided()+")", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke());
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 4", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 5", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke());
-	}
-	
-	public void test2() {
-		export1.start();
-		
-		// Test invalidity
-		assertTrue("Check invalidity - 0", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 0", isFooServiceProvided());
-		assertEquals("Check number of provides - 0", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.start();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 3", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 3", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 4", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 5", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 5", isFooServiceProvided());
-		assertEquals("Check number of provides - 5", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 5", invoke());
-	}
-	
-	public void test3() {
-		foo1.start();
-		foo2.start();
-		
-		export1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo1.stop();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo2.stop();
-		assertTrue("Check invalidity - 3", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo1.start();
-		assertTrue("Check validity - 4", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke());
-	}
-	
-	public void test4() {
-		foo1.start();
-		foo2.start();
-		
-		export1.start();
-		assertTrue("Check validity - 1", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 1", isFooServiceProvided());
-		assertEquals("Check number of provides - 1", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 1", invoke());
-		
-		foo2.stop();
-		assertTrue("Check validity - 2", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 2", isFooServiceProvided());
-		assertEquals("Check number of provides - 2", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 2", invoke());
-		
-		foo1.stop();
-		assertTrue("Check invalidity - 3", export1.getState() == ComponentInstance.INVALID);
-		assertFalse("Check providing - 3", isFooServiceProvided());
-		assertEquals("Check number of provides - 3", countFooServiceProvided(), 0);
-		
-		foo2.start();
-		assertTrue("Check validity - 4", export1.getState() == ComponentInstance.VALID);
-		assertTrue("Check providing - 4", isFooServiceProvided());
-		assertEquals("Check number of provides - 4", countFooServiceProvided(), 1);
-		assertTrue("Check invocation - 4", invoke());
-	}
-	
-	
-	
-	private boolean isFooServiceProvided() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
-		return ref != null;
-	}
-	
-	private int countFooServiceProvided() {
-		ServiceReference[] refs = Utils.getServiceReferences(getContext(), BazService.class.getName(), "(instance.name="+export1.getInstanceName()+")");
-		return refs.length;
-	}
-	
-	private boolean invoke() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), export1.getInstanceName());
-		if(ref == null) { return false; }
-		BazService fs = (BazService) getContext().getService(ref);
-		return fs.foo();
-	}
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
deleted file mode 100644
index c712945..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedFilteredImport.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedFilteredImport extends OSGiTestCase {
-	
-	ComponentInstance import1;
-	Factory fooProvider;
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
-		try {
-			import1 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		
-		import1.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import1.dispose();
-		foo1 = null;
-		foo2 = null;
-		import1 = null;
-	}
-	
-	public void testSimple() {
-		import1.start(); 
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo2.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import1.start(); 
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo2.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
deleted file mode 100644
index f215040..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedMultipleImport.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedMultipleImport extends OSGiTestCase {
-	
-	ComponentInstance import2;
-	Factory fooProvider;
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.2");
-		try {
-			import2 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		
-		import2.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import2.dispose();
-		foo1 = null;
-		foo2 = null;
-		import2 = null;
-	}
-	
-	public void testSimple() {
-		import2.start(); 
-		//Two providers
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		fs = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation (2)", fs.foo());
-		sc.ungetService(refs[1]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
-		
-		foo2.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import2.start(); 
-		//Two providers
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		fs = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[1]);
-		
-		foo2.stop();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
deleted file mode 100644
index 38cff7d..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalImport.java
+++ /dev/null
@@ -1,156 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedOptionalImport extends OSGiTestCase {
-	
-	ComponentInstance import3;
-	Factory fooProvider;
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.3");
-		try {
-			import3 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		
-		import3.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import3.dispose();
-		foo1 = null;
-		foo2 = null;
-		import3 = null;
-	}
-	
-	public void testSimple() {
-		import3.start(); 
-		//Two providers
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import3);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component validity - 2", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo non-availability inside the composite - 3.1", refs.length, 0);
-		
-		foo2.start();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import3.start(); 
-		//Two providers
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import3);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo2.stop();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component validity - 2", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 0);
-		
-		foo1.start();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
deleted file mode 100644
index 3cfa5e5..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedOptionalMultipleImport.java
+++ /dev/null
@@ -1,162 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedOptionalMultipleImport extends OSGiTestCase {
-	
-	ComponentInstance import4;
-	Factory fooProvider;
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.4");
-		try {
-			import4 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		
-		import4.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import4.dispose();
-		foo1 = null;
-		foo2 = null;
-		import4 = null;
-	}
-	
-	public void testSimple() {
-		import4.start(); 
-		//Two providers
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import4);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		fs = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation (2)", fs.foo());
-		sc.ungetService(refs[1]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component validity - 2", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo availability inside the composite - 1", refs.length, 0);
-		
-		foo2.start();
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import4.start(); 
-		//Two providers
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import4);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		fs = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[1]);
-		
-		foo2.stop();
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component validity - 2", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo availability inside the composite - 1", refs.length, 0);
-		
-		foo1.start();
-		assertTrue("Test component validity", import4.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import4);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
deleted file mode 100644
index 82deca3..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/DelayedSimpleImport.java
+++ /dev/null
@@ -1,151 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedSimpleImport extends OSGiTestCase {
-	
-	ComponentInstance import1;
-	Factory fooProvider;
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
-		try {
-			import1 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		
-		import1.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import1.dispose();
-		foo1 = null;
-		foo2 = null;
-		import1 = null;
-	}
-	
-	public void testSimple() {
-        import1.start();
-
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo2.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import1.start(); 
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo2.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
deleted file mode 100644
index 761bd41..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/FilteredImport.java
+++ /dev/null
@@ -1,147 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class FilteredImport extends OSGiTestCase {
-	
-	ComponentInstance import1;
-	Factory fooProvider;
-	Factory fooProvider2;
-	
-	ComponentInstance foo1, foo2;
-
-	public void setUp() {
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.5");
-		try {
-			import1 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-		import1.stop();
-		
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		fooProvider2 = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-2");
-		assertNotNull("Check fooProvider availability", fooProvider2);
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","foo1");
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo1 = fooProvider.createComponentInstance(p1);
-			foo2 = fooProvider2.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		foo1.dispose();
-		foo2.dispose();
-		import1.dispose();
-		foo1 = null;
-		foo2 = null;
-		import1 = null;
-	}
-	
-	public void testSimple() {
-		import1.start(); 
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo2.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}
-	
-	public void testSimple2() {
-		import1.start(); 
-		//Two providers
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo2.stop();
-		assertTrue("Test component invalidity - 1", import1.getState() == ComponentInstance.INVALID);
-		
-		// Stop the second provider
-		foo1.stop();		
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component invalidity - 3", import1.getState() == ComponentInstance.INVALID);
-		
-		foo2.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-	}	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/ImportTestSuite.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/ImportTestSuite.java
deleted file mode 100644
index 2f25b2c..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/ImportTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ImportTestSuite {
-
-	public static Test suite(BundleContext bc) {
-	    OSGiTestSuite ots = new OSGiTestSuite("Composite Import Test Suite", bc);
-	    ots.addTestSuite(SimpleImport.class);
-	    ots.addTestSuite(DelayedSimpleImport.class);
-	    ots.addTestSuite(OptionalImport.class);
-	    ots.addTestSuite(DelayedOptionalImport.class);
-	    ots.addTestSuite(MultipleImport.class);
-	    ots.addTestSuite(DelayedMultipleImport.class);
-	    ots.addTestSuite(OptionalMultipleImport.class);
-	    ots.addTestSuite(DelayedOptionalMultipleImport.class);
-	    ots.addTestSuite(FilteredImport.class);
-	    ots.addTestSuite(DelayedFilteredImport.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
deleted file mode 100644
index 135c6c8..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/MultipleImport.java
+++ /dev/null
@@ -1,190 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MultipleImport extends OSGiTestCase {
-	
-	ComponentInstance import2;
-	Factory fooProvider;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.2");
-		try {
-			import2 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		import2.dispose();
-		import2 = null;
-	}
-	
-	public void testSimple() {
-		// No provider -> Invalid
-		assertTrue("Test component invalidity", import2.getState() == ComponentInstance.INVALID);
-		
-		ComponentInstance foo = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2 ("+refs.length+")", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		FooService fs2 = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs2.foo());
-		sc.ungetService(refs[0]);
-		sc.ungetService(refs[1]);
-		
-		// Stop the second provider
-		foo2.dispose();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the foo provider
-		foo.stop();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
-		
-		foo.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import2.getState() == ComponentInstance.INVALID);
-	}
-	
-	public void testSimple2() {
-		// No provider -> Invalid
-		assertTrue("Test component invalidity", import2.getState() == ComponentInstance.INVALID);
-		
-		ComponentInstance foo1 = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo1 = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2 ("+refs.length+")", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		FooService fs2 = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs2.foo());
-		sc.ungetService(refs[0]);
-		sc.ungetService(refs[1]);
-		
-		// Stop the first provider
-		foo1.stop();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the second foo provider
-		foo2.dispose();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import2.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import2.getState() == ComponentInstance.INVALID);
-	}
-
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
deleted file mode 100644
index 985b834..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalImport.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class OptionalImport extends OSGiTestCase {
-	
-	ComponentInstance import3;
-	Factory fooProvider;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.3");
-		try {
-			import3 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		import3.dispose();
-		import3 = null;
-	}
-	
-	public void testSimple() {
-		// No provider -> valid
-		assertTrue("Test component invalidity", import3.getState() == ComponentInstance.VALID);
-		
-		ComponentInstance foo = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import3);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.dispose();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the foo provider
-		foo.stop();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import3.getState() == ComponentInstance.VALID);
-		
-		foo.start();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import3.getState() == ComponentInstance.VALID);
-	}
-	
-	public void testSimple2() {
-		// No provider -> valid
-		assertTrue("Test component invalidity", import3.getState() == ComponentInstance.VALID);
-		
-		ComponentInstance foo1 = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo1 = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import3);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo1.stop();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the foo provider
-		foo2.dispose();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import3.getState() == ComponentInstance.VALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import3.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import3);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import3.getState() == ComponentInstance.VALID);
-	}
-
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
deleted file mode 100644
index 4269ef5..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/OptionalMultipleImport.java
+++ /dev/null
@@ -1,201 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class OptionalMultipleImport extends OSGiTestCase {
-	
-	ComponentInstance import2;
-	Factory fooProvider;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.4");
-		try {
-			import2 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		import2.dispose();
-		import2 = null;
-	}
-	
-	public void testSimple() {
-		// No provider -> valid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		
-		ComponentInstance foo = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2 ("+refs.length+")", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		FooService fs2 = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs2.foo());
-		sc.ungetService(refs[0]);
-		sc.ungetService(refs[1]);
-		
-		// Stop the second provider
-		foo2.dispose();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the foo provider
-		foo.stop();
-		
-		// No provider -> valid
-		assertTrue("Test component validity - 2", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo non-availability inside the composite - 1", refs.length, 0);
-		
-		foo.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component validity - 3", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo non-availability inside the composite - 2", refs.length, 0);
-	}
-	
-	public void testSimple2() {
-		// No provider -> Invalid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		
-		ComponentInstance foo1 = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo1 = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import2);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2 ("+refs.length+")", refs.length, 2);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		FooService fs2 = (FooService) sc.getService(refs[1]);
-		assertTrue("Test foo invocation", fs2.foo());
-		sc.ungetService(refs[0]);
-		sc.ungetService(refs[1]);
-		
-		// Stop the first provider
-		foo1.stop();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the second foo provider
-		foo2.dispose();
-		
-		// No provider -> Invalid
-		assertTrue("Test component validity - 2", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo non-availability inside the composite - 1", refs.length, 0);
-		
-		foo1.start();
-		assertTrue("Test component validity", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import2.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import2);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertEquals("Test foo non-availability inside the composite - 2", refs.length, 0);
-	}
-
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java b/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
deleted file mode 100644
index 897d6e7..0000000
--- a/ipojo/tests/composite/import-export/src/main/java/org/apache/felix/ipojo/test/composite/importer/SimpleImport.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.importer;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleImport extends OSGiTestCase {
-	
-	ComponentInstance import1;
-	Factory fooProvider;
-
-	public void setUp() {
-		fooProvider = Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-		assertNotNull("Check fooProvider availability", fooProvider);
-		
-		Properties p = new Properties();
-		p.put("instance.name","importer");
-		Factory compFact = Utils.getFactoryByName(getContext(), "composite.requires.1");
-		try {
-			import1 = compFact.createComponentInstance(p);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate the component : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		import1.dispose();
-		import1 = null;
-	}
-	
-	public void testSimple() {
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 0 ("+import1.getState()+")", import1.getState() == ComponentInstance.INVALID);
-		
-		ComponentInstance foo = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity - 1", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the second provider
-		foo2.dispose();
-		assertTrue("Test component validity - 2", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the foo provider
-		foo.stop();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo.start();
-		assertTrue("Test component validity - 3", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import1.getState() == ComponentInstance.INVALID);
-	}
-	
-	public void testSimple2() {
-		// No provider -> Invalid
-		assertTrue("Test component invalidity", import1.getState() == ComponentInstance.INVALID);
-		
-		ComponentInstance foo1 = null;
-		Properties p = new Properties();
-		p.put("instance.name","foo");
-		try {
-			foo1 = fooProvider.createComponentInstance(p);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo component " + e.getMessage());
-		}
-		
-		ComponentInstance foo2 = null;
-		Properties p2 = new Properties();
-		p2.put("instance.name","foo2");
-		try {
-			foo2 = fooProvider.createComponentInstance(p2);
-		} catch(Exception e) {
-			fail("Fail to instantiate the foo2 component " + e.getMessage());
-		}
-		
-		// The foo service is available => import1 must be valid
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(import1);
-		ServiceReference[] refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 1", refs);
-		assertEquals("Test foo availability inside the composite - 1.2", refs.length, 1);
-		FooService fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// Stop the first provider
-		foo1.stop();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 2", refs);
-		assertEquals("Test foo availability inside the composite - 2.1 ("+refs.length+")", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		// stop the second foo provider
-		foo2.dispose();
-		
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 2", import1.getState() == ComponentInstance.INVALID);
-		
-		foo1.start();
-		assertTrue("Test component validity", import1.getState() == ComponentInstance.VALID);
-		sc = Utils.getServiceContext(import1);
-		refs = Utils.getServiceReferences(sc, FooService.class.getName(), null);
-		assertNotNull("Test foo availability inside the composite - 3", refs);
-		assertEquals("Test foo availability inside the composite - 3.1", refs.length, 1);
-		fs = (FooService) sc.getService(refs[0]);
-		assertTrue("Test foo invocation", fs.foo());
-		sc.ungetService(refs[0]);
-		
-		foo1.dispose(); 
-		// No provider -> Invalid
-		assertTrue("Test component invalidity - 3", import1.getState() == ComponentInstance.INVALID);
-	}	
-
-}
diff --git a/ipojo/tests/composite/import-export/src/main/resources/metadata.xml b/ipojo/tests/composite/import-export/src/main/resources/metadata.xml
deleted file mode 100644
index 7924d37..0000000
--- a/ipojo/tests/composite/import-export/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,87 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd 
-	    org.apache.felix.composite http://felix.apache.org/ipojo/schemas/SNAPSHOT/composite.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:comp="org.apache.felix.ipojo.composite"
-	xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
-	<comp:composite name="composite.requires.1" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService"
-			scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.requires.2" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService"
-			aggregate="true" scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.requires.3" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService"
-			optional="true" scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.requires.4" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService"
-			optional="true" aggregate="true" scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.requires.5" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService"
-			filter="(&amp;(int=2)(long=40))" scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.export.1" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" optional="true" filter="(!(instance.name=export))"
-			scope="composite" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService" />
-	</comp:composite>
-
-	<comp:composite name="composite.export.2" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			scope="composite" aggregate="true" optional="true"
-			filter="(!(instance.name=export))" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			optional="true" />
-	</comp:composite>
-
-	<comp:composite name="composite.export.3" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			scope="composite" aggregate="true" optional="true"
-			filter="(!(instance.name=export))" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" />
-	</comp:composite>
-
-	<comp:composite name="composite.export.4" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" optional="true" filter="(!(instance.name=export))"
-			scope="composite" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" optional="true" />
-	</comp:composite>
-
-	<comp:composite name="composite.export.5" architecture="true">
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" optional="true" filter="(!(instance.name=export))"
-			scope="composite" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			filter="(instance.name=foo1)" />
-	</comp:composite>
-
-</ipojo>
diff --git a/ipojo/tests/composite/service-instance/pom.xml b/ipojo/tests/composite/service-instance/pom.xml
deleted file mode 100644
index e486eb6..0000000
--- a/ipojo/tests/composite/service-instance/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Composite (Service Instance) Test Suite</name>
-  <artifactId>tests.composite.service.instance</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.composite.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>${ipojo.composite.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-          <groupId>org.osgi</groupId>
-          <artifactId>org.osgi.compendium</artifactId>
-         <version>4.0.0</version>
-      </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.composite</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.composite.instantiator*, org.apache.felix.ipojo.test.composite.instance, org.apache.felix.ipojo.test.instance
-            </Private-Package>
-            <Export-Package>org.apache.felix.ipojo.test.instance.service</Export-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.composite.instantiator.InstantiatorTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java
deleted file mode 100644
index 3aae2e5..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/InstanceScopeTest.java
+++ /dev/null
@@ -1,78 +0,0 @@
-package org.apache.felix.ipojo.test.composite.instance;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.composite.CompositeFactory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.apache.felix.ipojo.test.instance.service.Service;
-import org.osgi.framework.ServiceReference;
-
-public class InstanceScopeTest extends OSGiTestCase {
-    
-    CompositeFactory factory;
-    ComponentInstance instance;
-    
-    public void setUp() {
-        factory = (CompositeFactory) Utils.getFactoryByName(getContext(), "SCOPE-scope");
-        assertNotNull("Factory", factory);
-        try {
-            instance = factory.createComponentInstance(null);
-        } catch (Exception e) {
-            fail("Fail instantiation : " + e.getMessage());
-        }
-       
-
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        instance = null;
-    }
-    
-    public void testScope() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-        assertNotNull("Check architecture availability", ref);
-        Architecture arch = (Architecture) getContext().getService(ref);
-        assertTrue("Validity", arch.getInstanceDescription().getState() == ComponentInstance.VALID);
-        
-        // Get internal service
-        ServiceContext sc = Utils.getServiceContext(instance);
-        ServiceReference ref2 = Utils.getServiceReference(sc, CheckService.class.getName(), null);
-        assertNotNull("Check CheckService availability", ref2);
-        CheckService svc = (CheckService) sc.getService(ref2);
-        Properties props = svc.getProps();
-        assertEquals("Check props - 1", 1, ((Integer) props.get("1")).intValue());
-        assertEquals("Check props - 2", 2, ((Integer) props.get("2")).intValue());
-        assertEquals("Check props - 3", 3, ((Integer) props.get("3")).intValue());
-        
-    }
-    
-    public void testGlobalUnavailability() {
-        ServiceReference ref2 = Utils.getServiceReference(getContext(), Service.class.getName(), null);
-        assertNull("Check Service unavailability", ref2);
-    }
-    
-    public void testScopeUnvailability() {
-        CompositeFactory factory2 = (CompositeFactory) Utils.getFactoryByName(getContext(), "SCOPE-badscope");
-        assertNotNull("Factory", factory2);
-        ComponentInstance instance2 = null;
-        try {
-            instance2 = factory2.createComponentInstance(null);
-        } catch (Exception e) {
-            fail("Fail instantiation : " + e.getMessage());
-        }
-        //System.out.println(instance2.getInstanceDescription().getDescription());
-        
-        assertEquals("Check invalidity", ComponentInstance.INVALID, instance2.getState());
-        instance2.dispose();
- 
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
deleted file mode 100644
index 5b41d74..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instance/SimpleInstance.java
+++ /dev/null
@@ -1,264 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instance;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.composite.CompositeInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleInstance extends OSGiTestCase {
-
-	private ComponentFactory fooFactory1, fooFactory2;
-    private ComponentFactory compoFactory;
-	private ComponentInstance empty;
-	
-	
-	public void setUp() {
-        fooFactory1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-1");
-        fooFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooProviderType-Dyn2");
-        compoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.inst.1");
-		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty-X");
-		try {
-			empty = fact.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot create the empty composite : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testCreation() {
-		Properties props = new Properties();
-		props.put("instance.name","under-A");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate under from " + compoFactory.getName() + " -> " + e.getMessage());
-		}      
-		
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailability() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-       
-		assertNotNull("Check service availability", sc.getServiceReference(FooService.class.getName()));
-        assertEquals("Check service provider", Utils.getServiceReferences(sc, FooService.class.getName(), null).length, 2);
-		
-		under.dispose();
-	}
-	
-	public void testCreationLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailabilityLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under-X");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-        
-        assertNotNull("Check service availability", sc2.getServiceReference(FooService.class.getName()));
-        assertEquals("Check service providers", Utils.getServiceReferences(sc2, FooService.class.getName(), null).length, 2);
-		
-		under.dispose();
-	}
-	
-	public void testFactoryManagement() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		fooFactory1.stop();
-		assertTrue("Check instance invalidity - 2", under.getState() == ComponentInstance.INVALID);
-        
-        fooFactory1.start();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-        
-		fooFactory2.stop();
-        assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		
-		fooFactory2.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fooFactory1.start();
-		fooFactory2.start();
-	}
-	
-	public void testFactoryManagementLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-        
-        fooFactory1.stop();
-        assertTrue("Check instance invalidity - 2", under.getState() == ComponentInstance.INVALID);
-        
-        fooFactory1.start();
-        assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-        
-        fooFactory2.stop();
-        assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-        
-        fooFactory2.start();
-        assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-        
-        under.dispose();
-        fooFactory1.start();
-        fooFactory2.start();
-	}
-	
-	public void atestArchitecture() { // TODO fix and reactivate the method.
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compoFactory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		ServiceReference ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");
-		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) getContext().getService(ref);
-		CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();
-		
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		InstanceDescription[] contained = id.getContainedInstances();
-		assertEquals("Check contained instances count (" + contained.length + ")", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReference(getContext(), Architecture.class.getName(), "(architecture.instance=under)");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 0);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
deleted file mode 100644
index 510c3a6..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurableInstantiation.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ConfigurableInstantiation extends OSGiTestCase {
-
-	private ComponentFactory acceptF;
-	private ComponentFactory refuse1F;
-	private ComponentFactory refuse2F;
-	
-	public void setUp() {
-		acceptF = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-accept");
-		refuse1F = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-refuse1");
-		refuse2F = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.5-refuse2");
-		
-	}
-	
-	public void tearDown() { }
-	
-	public void testAccept() {
-		Properties props = new Properties();
-		props.put("instance.name","under-A");
-		ComponentInstance under = null;
-		try {
-			under = acceptF.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		ServiceReference ref = sc.getServiceReference(FooService.class.getName());
-		assertNotNull("Check refs not null", ref);
-		FooService foo = (FooService) sc.getService(ref);
-		Properties p = foo.fooProps();
-		boolean b = ((Boolean) p.get("boolProp")).booleanValue();
-		String s = (String) p.get("strProp");
-		int i = ( (Integer) p.get("intProp")).intValue();
-		assertTrue("Test boolean", b);
-		assertEquals("Test string", s, "foo");
-		//TODO See why it fails...
-		//assertEquals("Test int", i, 5); // The code fix to 5.
-		under.dispose();
-	}
-	
-	public void testRefuse1() {
-		Properties props = new Properties();
-		props.put("instance.name","under-ref1");
-		ComponentInstance under = null;
-		try {
-			under = refuse1F.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		
-		assertTrue("Check that under is not valid", under.getState() == ComponentInstance.INVALID);
-        
-        under.dispose();
-	}
-	
-	public void testRefuse2() {
-		Properties props = new Properties();
-		props.put("instance.name","under-ref2");
-		ComponentInstance under = null;
-		try {
-			under = refuse2F.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		
-		assertTrue("Check that under is not valid", under.getState() == ComponentInstance.INVALID);
-        
-        under.dispose();
-	}
-	
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurationTest.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurationTest.java
deleted file mode 100644
index bf6923c..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/ConfigurationTest.java
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class ConfigurationTest extends OSGiTestCase {
-
-	private ComponentFactory compositeFactory;
-
-	public void setUp() {
-		compositeFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "CONF-MySuperComposite");
-	}
-
-	public void tearDown() {
-
-	}
-
-	public void testDefaultInstantiation() throws InvalidSyntaxException {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = compositeFactory.createComponentInstance(props);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		ServiceReference[] refs = sc.getServiceReferences(FooService.class.getName(), null);
-		assertEquals(2, refs.length);
-		for (int i = 0; i < refs.length; i++) {
-			assertEquals(3, ((Integer) refs[i].getProperty("int")).intValue());
-			assertEquals("foo", (String) refs[i].getProperty("string"));
-		}
-		under.dispose();
-	}
-
-	public void testConfiguredInstantiation() throws InvalidSyntaxException {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		props.put("string", "bar");
-		props.put("int", "25");
-		ComponentInstance under = null;
-		try {
-			under = compositeFactory.createComponentInstance(props);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		ServiceReference[] refs = sc.getServiceReferences(FooService.class.getName(), null);
-		assertEquals(2, refs.length);
-		for (int i = 0; i < refs.length; i++) {
-			assertEquals(25, ((Integer) refs[i].getProperty("int")).intValue());
-			assertEquals("bar", (String) refs[i].getProperty("string"));
-		}
-		under.dispose();
-	}
-
-
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/InstantiatorTestSuite.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/InstantiatorTestSuite.java
deleted file mode 100644
index 1ae39b7..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/InstantiatorTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.composite.instance.InstanceScopeTest;
-import org.apache.felix.ipojo.test.composite.instance.SimpleInstance;
-import org.osgi.framework.BundleContext;
-
-public class InstantiatorTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Composite Service Instantiation Test Suite", bc);
-		ots.addTestSuite(SimpleInstantiation.class);
-		ots.addTestSuite(OptionalInstantiation.class);
-		ots.addTestSuite(MultipleInstantiation.class);
-		ots.addTestSuite(OptionalMultipleInstantiation.class);
-		ots.addTestSuite(ConfigurableInstantiation.class);
-		ots.addTestSuite(SimpleInstance.class);
-		ots.addTestSuite(InstanceScopeTest.class);
-		ots.addTestSuite(ConfigurationTest.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
deleted file mode 100644
index 2201507..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/MultipleInstantiation.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.composite.CompositeInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MultipleInstantiation extends OSGiTestCase {
-
-	private ComponentFactory bar2Factory;
-	private ComponentInstance empty;
-	
-	public void setUp() {
-		bar2Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.2");
-		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		try {
-			empty = fact.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot create the empty composite : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testCreation() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailability() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc.getServiceReference(BarService.class.getName()));
-		int count = Utils.getServiceReferences(sc, BarService.class.getName(), null).length;
-		assertEquals("Check service provider number : " + count, count, 3);
-		
-		under.dispose();
-	}
-	
-	public void testCreationLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailabilityLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc2.getServiceReference(BarService.class.getName()));
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 3);
-		
-		under.dispose();
-	}
-	
-	public void testFactoryManagement() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 2);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 1);
-		
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 0);
-		
-		fact1.start();
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 1);
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testFactoryManagementLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 2);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 1);
-		
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 0);
-		
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 1);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	public void testArchitecture() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) getContext().getService(ref);
-        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();
-		
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		InstanceDescription[] contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 3);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 2);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
-
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 0);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
-
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.2");
-
-		getContext().ungetService(ref);
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-	
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
deleted file mode 100644
index 398c34c..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalInstantiation.java
+++ /dev/null
@@ -1,266 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.composite.CompositeInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class OptionalInstantiation extends OSGiTestCase {
-
-	private ComponentFactory bar1Factory;
-	private ComponentInstance empty;
-	
-	public void setUp() {
-		bar1Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.3");
-		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		try {
-			empty = fact.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot create the empty composite : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testCreation() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailability() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc.getServiceReference(BarService.class.getName()));
-		
-		under.dispose();
-	}
-	
-	public void testCreationLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailabilityLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc2.getServiceReference(BarService.class.getName()));
-		
-		under.dispose();
-	}
-	
-	public void testFactoryManagement() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		
-		fact3.stop();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertNull("Check that no Bar Service is available", sc.getServiceReference(BarService.class.getName()));
-		
-		fact1.start();
-		assertTrue("Check instance validity - 5", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testFactoryManagementLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		
-		fact3.stop();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		
-		fact1.start();
-		assertTrue("Check instance validity - 5", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testArchitecture() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) getContext().getService(ref);
-		assertNotNull("Check architecture", arch);
-        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		InstanceDescription[] contained = id.getContainedInstances();
-		assertNotNull("Check contained not null", contained);
-		assertEquals("Check contained instances count ("+contained.length+") - 1", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
-
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 0);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
-
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.3");
-
-		getContext().ungetService(ref);
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
deleted file mode 100644
index d27643e..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/OptionalMultipleInstantiation.java
+++ /dev/null
@@ -1,193 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-
-public class OptionalMultipleInstantiation extends OSGiTestCase {
-
-	private ComponentFactory bar2Factory;
-	private ComponentInstance empty;
-	
-	public void setUp() {
-		bar2Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.4");
-		assertNotNull("Check bar2factory availability", bar2Factory);
-		
-		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty");
-		try {
-			empty = fact.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot create the empty composite : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testCreation() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailability() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc.getServiceReference(BarService.class.getName()));
-		int count = Utils.getServiceReferences(sc, BarService.class.getName(), null).length;
-		assertEquals("Check service provider number : " + count, count, 3);
-		
-		under.dispose();
-	}
-	
-	public void testCreationLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailabilityLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc2.getServiceReference(BarService.class.getName()));
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 3);
-		
-		under.dispose();
-	}
-	
-	public void testFactoryManagement() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 2);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 1);
-		
-		fact3.stop();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 0);
-		
-		fact1.start();
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc, BarService.class.getName(), null).length, 1);
-		assertTrue("Check instance validity - 5", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testFactoryManagementLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar2Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 2);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 1);
-		
-		fact3.stop();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 0);
-		
-		fact1.start();
-		assertTrue("Check instance validity - 5", under.getState() == ComponentInstance.VALID);
-		assertEquals("Check service provider number", Utils.getServiceReferences(sc2, BarService.class.getName(), null).length, 1);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
deleted file mode 100644
index 04f81c4..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/composite/instantiator/SimpleInstantiation.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.instantiator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.composite.CompositeInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BarService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleInstantiation extends OSGiTestCase {
-
-	private ComponentFactory bar1Factory;
-	private ComponentInstance empty;
-	
-	public void setUp() {
-		bar1Factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "composite.bar.1");
-		Factory fact = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties props = new Properties();
-		props.put("instance.name","empty-X");
-		try {
-			empty = fact.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot create the empty composite : " + e.getMessage());
-		}
-	}
-	
-	public void tearDown() {
-		empty.dispose();
-		empty = null;
-	}
-	
-	public void testCreation() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailability() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc.getServiceReference(BarService.class.getName()));
-		
-		under.dispose();
-	}
-	
-	public void testCreationLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		under.dispose();
-	}
-	
-	public void testServiceAvailabilityLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under-X");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}	
-		assertTrue("Check instance validity", under.getState() == ComponentInstance.VALID);
-		ServiceContext sc2 = Utils.getServiceContext(under);
-		assertNotNull("Check service availability", sc2.getServiceReference(BarService.class.getName()));
-		
-		under.dispose();
-	}
-	
-	public void testFactoryManagement() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testFactoryManagementLevel2() {
-		ServiceContext sc = Utils.getServiceContext(empty);
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props, sc);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		assertTrue("Check instance validity - 1", under.getState() == ComponentInstance.VALID);
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-	
-	public void testArchitecture() {
-		Properties props = new Properties();
-		props.put("instance.name","under");
-		ComponentInstance under = null;
-		try {
-			under = bar1Factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate under : " + e.getMessage());
-		}
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		Architecture arch = (Architecture) getContext().getService(ref);
-        CompositeInstanceDescription id = (CompositeInstanceDescription) arch.getInstanceDescription();
-		
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		InstanceDescription[] contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-		
-		ComponentFactory fact1 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-1");
-		ComponentFactory fact2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-2");
-		ComponentFactory fact3 = (ComponentFactory) Utils.getFactoryByName(getContext(), "COMPO-FooBarProviderType-3");
-		
-		fact1.stop();
-		assertTrue("Check instance validity - 2", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-		
-		fact2.stop();
-		assertTrue("Check instance validity - 3", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		fact3.stop();
-		assertTrue("Check instance invalidity", under.getState() == ComponentInstance.INVALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.INVALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 0);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		fact1.start();
-		assertTrue("Check instance validity - 4", under.getState() == ComponentInstance.VALID);
-		ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "under");
-		assertNotNull("Check architecture availability", ref);
-		arch = (Architecture) getContext().getService(ref);
-		//id = arch.getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		contained = id.getContainedInstances();
-		assertEquals("Check contained instances count", contained.length, 1);
-		assertEquals("Check instance name" , id.getName(), "under");
-		assertEquals("Check component type name" , id.getComponentDescription().getName(), "composite.bar.1");
-
-		under.dispose();
-		fact2.start();
-		fact3.start();
-	}
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceConsumer.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceConsumer.java
deleted file mode 100644
index d6abe0a..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceConsumer.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.felix.ipojo.test.instance;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.instance.service.Service;
-
-public class ServiceConsumer implements CheckService {
-    
-    private Service service;
-    private Properties props = new Properties();
-    
-    public ServiceConsumer() {
-       props.put("1", new Integer(service.count()));
-       props.put("2", new Integer(service.count()));
-       props.put("3", new Integer(service.count()));
-    }
-
-    public boolean check() {
-       return service.count() > 0;
-    }
-
-    public Properties getProps() {
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceProvider.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceProvider.java
deleted file mode 100644
index 7c12a12..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/ServiceProvider.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test.instance;
-
-import org.apache.felix.ipojo.test.instance.service.Service;
-
-
-public class ServiceProvider implements Service {
-
-    private int i = 0;
-    
-    public int count() {
-        i++;
-        return i;
-    }
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/service/Service.java b/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/service/Service.java
deleted file mode 100644
index 4c64172..0000000
--- a/ipojo/tests/composite/service-instance/src/main/java/org/apache/felix/ipojo/test/instance/service/Service.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.instance.service;
-
-public interface Service {
-    
-    public int count();
-
-}
diff --git a/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml b/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml
deleted file mode 100644
index ede6935..0000000
--- a/ipojo/tests/composite/service-instance/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,89 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd
-	    org.apache.felix.composite http://felix.apache.org/ipojo/schemas/SNAPSHOT/composite.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:comp="org.apache.felix.ipojo.composite"
-	xmlns:cs="org.apache.felix.ipojo.test.composite.handler.CheckServiceHandler">
-	<comp:composite name="composite.bar.1" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService"/>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.2" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" aggregate="true"/>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.3" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService" optional="true"/>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.4" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService" aggregate="true" optional="true"/>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.5-accept" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.FooService">
-			<property name="boolean" value="true"/>
-			<property name="string" value="foo"/>
-			<property name="strAprop" value="{foo, bar, baz}"/>
-			<property name="int" value="5"/>
-		</subservice>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.5-refuse1" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
-			<property name="foo" value="bar"/>
-			<property name="boolean" value="true"/>
-			<property name="string" value="foo"/>
-			<property name="strAprop" value="{foo, bar, baz}"/>
-			<property name="int" value="5"/>
-		</subservice>
-	</comp:composite>
-
-	<comp:composite name="composite.bar.5-refuse2" architecture="true">
-		<subservice action="instantiate" specification="org.apache.felix.ipojo.test.composite.service.BarService">
-			<property name="string" value="foo"/>
-			<property name="strAprop" value="{foo, bar, baz}"/>
-		</subservice>
-	</comp:composite>
-
-    <!-- Instance of a specified component -->
-	<comp:composite name="composite.inst.1" architecture="true">
-		<instance component="COMPO-FooProviderType-1" /> <!-- name="FooProv"  -->
-		<instance component="COMPO-FooProviderType-Dyn2">
-			<property name="boolean" value="true"/>
-			<property name="string" value="foo"/>
-			<property name="strAProp" value="{a,b,c}"/>
-		</instance>
-	</comp:composite>
-
-	<!-- Scope test -->
-	<component name="SCOPE-provider" classname="org.apache.felix.ipojo.test.instance.ServiceProvider">
-		<provides/>
-	</component>
-	<component name="SCOPE-cons" classname="org.apache.felix.ipojo.test.instance.ServiceConsumer">
-		<provides/>
-		<requires field="service"/>
-	</component>
-	<comp:composite name="SCOPE-scope">
-		<instance component="SCOPE-provider"/>
-		<instance component="SCOPE-cons"/>
-	</comp:composite>
-	<comp:composite name="SCOPE-badscope">
-		<instance component="SCOPE-cons"/>
-	</comp:composite>
-
-	<!-- Instance configuration  -->
-	<comp:composite name="CONF-MySuperComposite">
-                <instance component="COMPO-FooProviderType-2">
-                               <property name="int" value="3"/>
-                </instance>
-                <subservice action="instantiate"
-					specification="org.apache.felix.ipojo.test.composite.service.FooService">
-					<property name="boolean" value="true"/>
-					<property name="string" value="foo"/>
-					<property name="strAprop" value="{foo, bar, baz}"/>
-					<property name="int" value="3"/>
-				</subservice>
-	</comp:composite>
-</ipojo>
diff --git a/ipojo/tests/composite/service-providing/pom.xml b/ipojo/tests/composite/service-providing/pom.xml
deleted file mode 100644
index f1069bb..0000000
--- a/ipojo/tests/composite/service-providing/pom.xml
+++ /dev/null
@@ -1,110 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-    <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Composite (Service Providing) Test Suite</name>
-  <artifactId>tests.composite.service.providing</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.composite.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.composite</artifactId>
-      <version>${ipojo.composite.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.composite</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.composite.provides, org.apache.felix.ipojo.test.composite.test
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.composite.test.CompositeTest, org.apache.felix.ipojo.test.composite.provides.ProvidesTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/ProvidesTestSuite.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/ProvidesTestSuite.java
deleted file mode 100644
index 413ff58..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/ProvidesTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ProvidesTestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Composite Service Providing Test Suite", bc);
-        ots.addTestSuite(TestComp0.class);
-        ots.addTestSuite(TestComp1.class);
-        ots.addTestSuite(TestComp2.class);
-        ots.addTestSuite(TestComp3.class);
-        ots.addTestSuite(TestComp4.class);
-        ots.addTestSuite(TestComp5.class);
-        ots.addTestSuite(TestComp6.class);
-        ots.addTestSuite(TestComp7.class);
-        ots.addTestSuite(TestComp8.class);
-        
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java
deleted file mode 100644
index 5e936b3..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp0.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.service.Toto;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp0 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    private ComponentFactory tataFactory2;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-    
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-           fail("Cannot create an instance : " + e.getMessage());
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            fail("Cannot create an instance : " + e.getMessage());
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-0");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-            fail("Cannot create an instance : " + e.getMessage());
-        }
-    }
-    
-    public void tearDown() {
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertNotNull("Assert toto service - 1", getContext().getServiceReference(Toto.class.getName()));
-        assertTrue("Assert under state - 2", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 3", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        Integer tataStr = (Integer) props.get("tataStr");
-        Integer tataStrs = (Integer) props.get("tataStrs");
-        Integer tata_2 = (Integer) props.get("tata_2");
-        Integer tata_3 = (Integer) props.get("tata_3");
-        Integer tata1 = (Integer) props.get("tata1");
-        Integer tata1_1 = (Integer) props.get("tata1_1");
-        Integer tata5 = (Integer) props.get("tata5");
-        Integer tata5_1 = (Integer) props.get("tata5_1");
-        Integer tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 3", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 3", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 3", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 3", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 3", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 3", tata1_1.intValue(), 1);
-        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);
-        
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 4", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        assertEquals("Assert tataStr - 4", tataStr.intValue(), 2);
-        assertEquals("Assert tataStrs - 4", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 4", tata_2.intValue(), 2);
-        assertEquals("Assert tata_3 - 4", tata_3.intValue(), 2);
-        assertEquals("Assert tata1 - 4", tata1.intValue(), 2);
-        assertEquals("Assert tata1_1 - 4", tata1_1.intValue(), 2);
-        assertEquals("Assert tata5 - 4", tata5.intValue(), 2);
-        assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
-        assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 6", toto.intValue(), 3);
-        assertEquals("Assert toto_2 - 6", toto_2.intValue(), 3);
-        assertEquals("Assert toto_3 - 6", toto_3.intValue(), 3);
-        assertEquals("Assert toto_4 - 6", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 6", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 6", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 6", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 6", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 6", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 6", tata1_1.intValue(), 1);
-        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);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        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(getContext(), Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
-        
-        under.dispose();
-        under = null;
-    }
-
-
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    private void invokeArrays(Tota tota) {
-        
-        int[] a = new int[] {1,2,3};
-        assertEquals("Assert invoke tataint[]", tota.tataInts(a), a);
-        
-        long[] b = new long[] {1,2,3};
-        assertEquals("Assert invoke tataLong[]", tota.tataLongs(b), b);
-        
-        double[] c = new double[] {1,2,3};
-        assertEquals("Assert invoke tataDouble[]", tota.tataDoubles(c), c);
-        
-        char[] d = new char[] {'a','b', 'c'};
-        assertEquals("Assert invoke tataChar[]", tota.tataChars(d), d);
-        
-        boolean[] e = new boolean[] {true, false};
-        assertEquals("Assert invoke tataBoolean[]", tota.tataBooleans(e), e);
-        
-        byte[] f = new byte[] {(byte) 1};
-        assertEquals("Assert invoke tataByte[]", tota.tataBytes(f), f);
-        
-        short[] g = new short[] {(short) 1};
-        assertEquals("Assert invoke tataShort[]", tota.tataShorts(g), g);
-        
-        float[] h = new float[] {5,6,7};
-        assertEquals("Assert invoke tataFloat[]", tota.tataFloats(h), h);
-        
-    }
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeTata(Tota tota) {
-        tota.tata(1,2);
-        tota.tata("tototototo");
-    }
-    
-    private void invokeTata1(Tota tota) {
-        assertEquals("Assert tata1", tota.tata1("foo"), "foo");
-        assertEquals("Assert tata1 - 2", tota.tata1(new char[] {'a','b','c'}), "abc");
-    }
-    
-    private void invokeTata5(Tota tota) {
-        assertEquals("Assert tata5 -1", tota.tata5("foo",1), "foo"+1);
-        assertEquals("Assert tata5 - 2", tota.tata5(new String[] {"a","b","c"}, 1), "31");
-        assertEquals("Assert tata5 - 3", tota.tata5("foo", new int[] {1,2,3}), "foo3");
-    }
-    
-    private void invokeAdd(Tota tota) {
-        assertEquals("Assert add", tota.add(1,1,1), 3);
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        invokeArrays(tota);
-        invokeStr(tota);
-        invokeTata(tota);
-        invokeTata1(tota);
-        invokeTata5(tota);
-        invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java
deleted file mode 100644
index 17613fc..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp1.java
+++ /dev/null
@@ -1,337 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp1 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-	private ComponentFactory tataFactory2;
-    
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-1");
-        Properties props2 = new Properties();
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            fail("Cannot create the instance : " + e.getMessage());
-        }
-         
-    }
-    
-    public void tearDown() {  
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        Integer tataStr = (Integer) props.get("tataStr");
-        Integer tataStrs = (Integer) props.get("tataStrs");
-        Integer tata_2 = (Integer) props.get("tata_2");
-        Integer tata_3 = (Integer) props.get("tata_3");
-        Integer tata1 = (Integer) props.get("tata1");
-        Integer tata1_1 = (Integer) props.get("tata1_1");
-        Integer tata5 = (Integer) props.get("tata5");
-        Integer tata5_1 = (Integer) props.get("tata5_1");
-        Integer tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 3", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 3", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 3", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 3", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 3", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 3", tata1_1.intValue(), 1);
-        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);
-        
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 4", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        assertEquals("Assert tataStr - 4", tataStr.intValue(), 2);
-        assertEquals("Assert tataStrs - 4", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 4", tata_2.intValue(), 2);
-        assertEquals("Assert tata_3 - 4", tata_3.intValue(), 2);
-        assertEquals("Assert tata1 - 4", tata1.intValue(), 2);
-        assertEquals("Assert tata1_1 - 4", tata1_1.intValue(), 2);
-        assertEquals("Assert tata5 - 4", tata5.intValue(), 2);
-        assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
-        assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 6", toto.intValue(), 3);
-        assertEquals("Assert toto_2 - 6", toto_2.intValue(), 3);
-        assertEquals("Assert toto_3 - 6", toto_3.intValue(), 3);
-        assertEquals("Assert toto_4 - 6", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 6", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 6", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 6", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 6", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 6", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 6", tata1_1.intValue(), 1);
-        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);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), under.getInstanceName()));
-        
-        totoProv.stop();
-        
-        assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), under.getInstanceName()));
-        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
-        
-        under.dispose();
-        under = null;
-    }
-
-
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    private void invokeArrays(Tota tota) {
-        
-        int[] a = new int[] {1,2,3};
-        assertEquals("Assert invoke tataint[]", tota.tataInts(a), a);
-        
-        long[] b = new long[] {1,2,3};
-        assertEquals("Assert invoke tataLong[]", tota.tataLongs(b), b);
-        
-        double[] c = new double[] {1,2,3};
-        assertEquals("Assert invoke tataDouble[]", tota.tataDoubles(c), c);
-        
-        char[] d = new char[] {'a','b', 'c'};
-        assertEquals("Assert invoke tataChar[]", tota.tataChars(d), d);
-        
-        boolean[] e = new boolean[] {true, false};
-        assertEquals("Assert invoke tataBoolean[]", tota.tataBooleans(e), e);
-        
-        byte[] f = new byte[] {(byte) 1};
-        assertEquals("Assert invoke tataByte[]", tota.tataBytes(f), f);
-        
-        short[] g = new short[] {(short) 1};
-        assertEquals("Assert invoke tataShort[]", tota.tataShorts(g), g);
-        
-        float[] h = new float[] {5,6,7};
-        assertEquals("Assert invoke tataFloat[]", tota.tataFloats(h), h);
-        
-    }
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeTata(Tota tota) {
-        tota.tata(1,2);
-        tota.tata("tototototo");
-    }
-    
-    private void invokeTata1(Tota tota) {
-        assertEquals("Assert tata1", tota.tata1("foo"), "foo");
-        assertEquals("Assert tata1 - 2", tota.tata1(new char[] {'a','b','c'}), "abc");
-    }
-    
-    private void invokeTata5(Tota tota) {
-        assertEquals("Assert tata5 -1", tota.tata5("foo",1), "foo"+1);
-        assertEquals("Assert tata5 - 2", tota.tata5(new String[] {"a","b","c"}, 1), "31");
-        assertEquals("Assert tata5 - 3", tota.tata5("foo", new int[] {1,2,3}), "foo3");
-    }
-    
-    private void invokeAdd(Tota tota) {
-        assertEquals("Assert add", tota.add(1,1,1), 3);
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        invokeArrays(tota);
-        invokeStr(tota);
-        invokeTata(tota);
-        invokeTata1(tota);
-        invokeTata5(tota);
-        invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java
deleted file mode 100644
index 43e79b7..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp2.java
+++ /dev/null
@@ -1,232 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp2 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-	private ComponentFactory tataFactory2;
-
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-2");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-         
-    }
-    
-    public void tearDown() { 
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 4 ("+toto.intValue()+")", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4 ("+toto_2.intValue()+")", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 4", toto_1.intValue(), 3);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 6 ("+toto.intValue()+")", toto.intValue(), 3);
-        assertEquals("Assert toto_2 - 6 ("+toto_2.intValue()+")", toto_2.intValue(), 3);
-        assertEquals("Assert toto_3 - 6", toto_3.intValue(), 3);
-        assertEquals("Assert toto_4 - 6", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 6", toto_1.intValue(), 4);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        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(getContext(), Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
-        
-        under.dispose();
-        under = null;
-    }
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-        tota.toto1("foo2");
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        invokeToto(tota);
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java
deleted file mode 100644
index 41703e5..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp3.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp3 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-	private ComponentFactory tataFactory2;  
-    
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-3");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-         
-    }
-    
-    public void tearDown() {  
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 4 ("+toto.intValue()+")", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4 ("+toto_2.intValue()+")", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 4", toto_1.intValue(), 2);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Stop the factory
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
-        
-        totoProv2.stop();
-        totoProv.stop();
-        tataFactory.start();
-        assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAllOpt(tota);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata.intValue(), 1);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
-        
-        tataFactory.stop();
-        
-        assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        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;
-    }
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-        tota.toto1("foo");
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-    private void invokeAllOpt(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeTotoOpt(tota);
-    }
-    
-    private void invokeTotoOpt(Tota tota) {
-        try {
-            tota.toto();
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            assertEquals("Assert toto", tota.toto("foo"), "foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        
-        try {
-            tota.toto(1,2);
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            tota.toto1("foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java
deleted file mode 100644
index c5b65af..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp4.java
+++ /dev/null
@@ -1,261 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp4 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-	private ComponentFactory tataFactory2;
-
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-4");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-         
-    }
-    
-    public void tearDown() {  
-    	tataFactory2.start();
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 4 ("+toto.intValue()+")", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4 ("+toto_2.intValue()+")", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 4", toto_1.intValue(), 2);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Stop the factory
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
-        
-        totoProv2.stop();
-        totoProv.stop();
-        tataFactory.start();
-        assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAllOpt(tota);
-        // Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
-        
-        tataFactory.stop();
-        
-        assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        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;
-    }
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-        tota.toto1("foo");
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-    private void invokeAllOpt(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeTotoOpt(tota);
-    }
-    
-    private void invokeTotoOpt(Tota tota) {
-        try {
-            tota.toto();
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            assertEquals("Assert toto", tota.toto("foo"), "foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        
-        try {
-            tota.toto(1,2);
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            tota.toto1("foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java
deleted file mode 100644
index f01dc7a..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp5.java
+++ /dev/null
@@ -1,265 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp5 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-	private ComponentFactory tataFactory2;
-
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        tataFactory2 = (ComponentFactory) Utils.getFactoryByName(getContext(), "comp-6");
-        tataFactory2.stop();
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-5");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-            fail("Cannot create an instance from comp-5 : " + e.getMessage());
-        }
-         
-    }
-    
-    public void tearDown() {    
-    	tataFactory2.start();
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 1", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        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", 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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 4 ("+toto.intValue()+")", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4 ("+toto_2.intValue()+")", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 4", toto_1.intValue(), 3);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Stop the factory
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        assertNull("Assert no tota service - 5", getContext().getServiceReference(Tota.class.getName()));
-        
-        totoProv2.stop();
-        totoProv.stop();
-        tataFactory.start();
-        assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        assertNotNull("Assert tota service - 6", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAllOpt(tota);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
-        
-        tataFactory.stop();
-        
-        assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        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;
-    }
-
-
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-        tota.toto1("foo");
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-    private void invokeAllOpt(Tota tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-        invokeTotoOpt(tota);
-    }
-    
-    private void invokeTotoOpt(Tota tota) {
-        try {
-            tota.toto();
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            assertEquals("Assert toto", tota.toto("foo"), "foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        
-        try {
-            tota.toto(1,2);
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-        	tota.toto1("foo");
-        	fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java
deleted file mode 100644
index 09edbc6..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp6.java
+++ /dev/null
@@ -1,284 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tata;
-import org.apache.felix.ipojo.test.composite.service.Toto;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp6 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-    
-    public void setUp() {
-        tataFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "tata");
-        totoFactory = (ComponentFactory) Utils.getFactoryByName(getContext(), "toto");
-        
-        tataFactory.stop();
-        
-        Properties props = new Properties();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-6");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-         
-    }
-    
-    public void tearDown() {       
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        ServiceReference refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        ServiceReference refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNull("Assert no toto service - 1", refToto);
-        assertNull("Assert no tata service - 1", refTata);
-
-        // Start the importer
-        totoProv.start();
-        assertTrue("Assert under state - 2 ("+under.getState()+")", under.getState() == ComponentInstance.INVALID);
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNull("Assert no toto service - 2", refToto);
-        assertNull("Assert no tata service - 2", refTata);
-
-        // Start the factory
-        tataFactory.start();
-        assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNotNull("Assert toto service - 3", refToto);
-        assertNotNull("Assert tata service - 3", refTata);
-        Toto toto = (Toto) getContext().getService(refToto);
-        Tata tata = (Tata) getContext().getService(refTata);
- 
-        invokeAll(tata);
-        invokeToto(toto);
- 
-        // Check toto
-        Properties props = toto.getProps();
-        Integer toto_0 = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 3 ("+toto_0.intValue()+")", toto_0.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 3 (" + toto_1.intValue() + ")", toto_1.intValue(), 1);
-        //Check tata
-        props = tata.getPropsTata();
-        Integer tata_0 = (Integer) props.get("tata");
-        assertEquals("Assert tata - 3", tata_0.intValue(), 1);
-
-        getContext().ungetService(refToto);
-        getContext().ungetService(refTata);
-        toto = null;
-        tata = null;
-        
-        // Start a second import
-        totoProv2.start();
-        assertTrue("Assert under state - 4", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNotNull("Assert toto service - 4", refToto);
-        assertNotNull("Assert tata service - 4", refTata);
-        
-        toto = (Toto) getContext().getService(refToto);
-        tata = (Tata) getContext().getService(refTata);
-        invokeAll(tata);
-        invokeToto(toto);
-
-        // Check toto
-        props = toto.getProps();
-        toto_0 = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        toto_1 = (Integer) props.get("toto1");
-        assertEquals("Assert toto - 4 ("+toto_0.intValue()+")", toto_0.intValue(), 2);
-        assertEquals("Assert toto_2 - 4 ("+toto_2.intValue()+")", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert toto1 - 4", toto_1.intValue(), 3);
-        //Check tata
-        props = tata.getPropsTata();
-        tata_0 = (Integer) props.get("tata");
-        assertEquals("Assert tata - 4", tata_0.intValue(), 2);
-        getContext().ungetService(refToto);
-        getContext().ungetService(refTata);
-        toto = null;
-        tata = null;
-
-        // Stop the factory
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNull("Assert no toto service - 5", refToto);
-        assertNull("Assert no tata service - 5", refTata);
- 
-        totoProv2.stop();
-        totoProv.stop();
-        tataFactory.start();
-        assertTrue("Assert under state - 6", under.getState() == ComponentInstance.VALID);
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNotNull("Assert toto service - 6", refToto);
-        assertNotNull("Assert tata service - 6", refTata);
-        toto = (Toto) getContext().getService(refToto);
-        tata = (Tata) getContext().getService(refTata);
- 
-        invokeAll(tata);
-        invokeTotoOpt(toto);
-        //  Check tata
-        props = tata.getPropsTata();
-        tata_0 = (Integer) props.get("tata");
-        assertEquals("Assert tata - 6", tata_0.intValue(), 1);
-        getContext().ungetService(refToto);
-        getContext().ungetService(refTata);
-        toto = null;
-        tata = null;
- 
-        // Is arch exposed
-        assertNotNull("Test arch", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
-        
-        tataFactory.stop();
-        
-        assertTrue("Assert under state - 7", under.getState() == ComponentInstance.INVALID);
-        assertNotNull("Test arch-2", Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "ff"));
-        refToto = Utils.getServiceReferenceByName(getContext(), Toto.class.getName(), "ff");
-        refTata = Utils.getServiceReferenceByName(getContext(), Tata.class.getName(), "ff");
-        assertNull("Assert no toto service - 7", refToto);
-        assertNull("Assert no tata service - 7", refTata);
-        
-        under.dispose();
-        under = null;
-    }
-
-    private void invoke(Tata tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    
-    private void invokeStr(Tata tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeToto(Toto tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-        tota.toto1("foo");
-    }
-    
-    private void invokeAll(Tata tota) {
-        invoke(tota);
-        //invokeArrays(tota);
-        invokeStr(tota);
-        //invokeTata(tota);
-        //invokeTata1(tota);
-        //invokeTata5(tota);
-        //invokeAdd(tota);
-    }
-    
-    private void invokeTotoOpt(Toto tota) {
-        try {
-            tota.toto();
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-            assertEquals("Assert toto", tota.toto("foo"), "foo");
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        
-        try {
-            tota.toto(1,2);
-            fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-        
-        try {
-        	tota.toto1("foo");
-        	fail("UnsupportedOperationException expected");
-        } catch(UnsupportedOperationException e) { }
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
deleted file mode 100644
index 2e2a2ef..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp7.java
+++ /dev/null
@@ -1,333 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp7 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    private ComponentFactory tataFactory2;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-    
-    public void setUp() {
-        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();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-7");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        tataFactory.stop();
-         
-    }
-    
-    public void tearDown() {
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-    }
-    
-    public void testSimple() {
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the factory
-        tataFactory.start();
-        assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 1);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        Integer tataStr = (Integer) props.get("tataStr");
-        Integer tataStrs = (Integer) props.get("tataStrs");
-        Integer tata_2 = (Integer) props.get("tata_2");
-        Integer tata_3 = (Integer) props.get("tata_3");
-        Integer tata1 = (Integer) props.get("tata1");
-        Integer tata1_1 = (Integer) props.get("tata1_1");
-        Integer tata5 = (Integer) props.get("tata5");
-        Integer tata5_1 = (Integer) props.get("tata5_1");
-        Integer tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 3", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 3", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 3", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 3", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 3", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 3", tata1_1.intValue(), 1);
-        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);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 4", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 2);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        assertEquals("Assert tataStr - 4", tataStr.intValue(), 2);
-        assertEquals("Assert tataStrs - 4", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 4", tata_2.intValue(), 2);
-        assertEquals("Assert tata_3 - 4", tata_3.intValue(), 2);
-        assertEquals("Assert tata1 - 4", tata1.intValue(), 2);
-        assertEquals("Assert tata1_1 - 4", tata1_1.intValue(), 2);
-        assertEquals("Assert tata5 - 4", tata5.intValue(), 2);
-        assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
-        assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
-
-        getContext().ungetService(ref);
-        tota = null;
-        
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        assertEquals("Assert toto - 6", toto.intValue(), 3);
-        assertEquals("Assert toto_2 - 6", toto_2.intValue(), 3);
-        assertEquals("Assert toto_3 - 6", toto_3.intValue(), 3);
-        assertEquals("Assert toto_4 - 6", toto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 6", 1, tata.intValue());
-        assertEquals("Assert tataStr - 6", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 6", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 6", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 6", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 6", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 6", tata1_1.intValue(), 1);
-        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);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        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(getContext(), Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
-        
-        under.dispose();
-        under = null;
-    }
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    private void invokeArrays(Tota tota) {
-        
-        int[] a = new int[] {1,2,3};
-        assertEquals("Assert invoke tataint[]", tota.tataInts(a), a);
-        
-        long[] b = new long[] {1,2,3};
-        assertEquals("Assert invoke tataLong[]", tota.tataLongs(b), b);
-        
-        double[] c = new double[] {1,2,3};
-        assertEquals("Assert invoke tataDouble[]", tota.tataDoubles(c), c);
-        
-        char[] d = new char[] {'a','b', 'c'};
-        assertEquals("Assert invoke tataChar[]", tota.tataChars(d), d);
-        
-        boolean[] e = new boolean[] {true, false};
-        assertEquals("Assert invoke tataBoolean[]", tota.tataBooleans(e), e);
-        
-        byte[] f = new byte[] {(byte) 1};
-        assertEquals("Assert invoke tataByte[]", tota.tataBytes(f), f);
-        
-        short[] g = new short[] {(short) 1};
-        assertEquals("Assert invoke tataShort[]", tota.tataShorts(g), g);
-        
-        float[] h = new float[] {5,6,7};
-        assertEquals("Assert invoke tataFloat[]", tota.tataFloats(h), h);
-        
-    }
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeTata(Tota tota) {
-        tota.tata(1,2);
-        tota.tata("tototototo");
-    }
-    
-    private void invokeTata1(Tota tota) {
-        assertEquals("Assert tata1", tota.tata1("foo"), "foo");
-        assertEquals("Assert tata1 - 2", tota.tata1(new char[] {'a','b','c'}), "abc");
-    }
-    
-    private void invokeTata5(Tota tota) {
-        assertEquals("Assert tata5 -1", tota.tata5("foo",1), "foo"+1);
-        assertEquals("Assert tata5 - 2", tota.tata5(new String[] {"a","b","c"}, 1), "31");
-        assertEquals("Assert tata5 - 3", tota.tata5("foo", new int[] {1,2,3}), "foo3");
-    }
-    
-    private void invokeAdd(Tota tota) {
-        assertEquals("Assert add", tota.add(1,1,1), 3);
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        invokeArrays(tota);
-        invokeStr(tota);
-        invokeTata(tota);
-        invokeTata1(tota);
-        invokeTata5(tota);
-        invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
deleted file mode 100644
index c11f643..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/provides/TestComp8.java
+++ /dev/null
@@ -1,365 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.provides;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.component.TotoProvider;
-import org.apache.felix.ipojo.test.composite.component.TotoProviderGlue;
-import org.apache.felix.ipojo.test.composite.service.Tota;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComp8 extends OSGiTestCase {
-
-    private ComponentFactory tataFactory;
-    private ComponentFactory totoFactory;
-    private ComponentFactory tataFactory2;
-    
-    private ComponentInstance totoProv, totoProv2;
-    private ComponentInstance under;
-    
-    public void setUp() {
-        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();
-        props.put("instance.name","toto provider");
-        try {
-            totoProv = totoFactory.createComponentInstance(props);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        Properties props3 = new Properties();
-        props3.put("instance.name","toto provider 2");
-        try {
-            totoProv2 = totoFactory.createComponentInstance(props3);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        
-        totoProv.stop();
-        totoProv2.stop();
-        
-        Factory factory = Utils.getFactoryByName(getContext(), "comp-8");
-        Properties props2 = new Properties();
-        props2.put("instance.name","ff");
-        try {
-            under = factory.createComponentInstance(props2);
-        } catch(Exception e) {
-            e.printStackTrace();
-        }
-        tataFactory.stop();
-         
-    }
-    
-    public void tearDown() {
-        tataFactory.start();
-        totoProv.dispose();
-        totoProv = null;
-        totoProv2.dispose();
-        totoProv2 = null;
-        tataFactory2.start();
-        
-        // Reset counters
-        TotoProvider.toto = 0;
-        TotoProvider.toto_2 = 0;
-        TotoProvider.toto_3 = 0;
-        TotoProvider.toto_4 = 0;
-        TotoProvider.toto1 = 0;
-        TotoProviderGlue.toto = 0;
-        TotoProviderGlue.toto_2 = 0;
-        TotoProviderGlue.toto_3 = 0;
-        TotoProviderGlue.toto_4 = 0;
-        TotoProviderGlue.toto1 = 0;
-    }
-    
-    public void testSimple() {        
-        // Neither factory nor instance
-        assertTrue("Assert under state - 1", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        
-        // Start the factory
-        tataFactory.start();
-        assertTrue("Assert under state - 3", under.getState() == ComponentInstance.VALID);
-        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();
-        Integer toto = (Integer) props.get("toto");
-        Integer toto_2 = (Integer) props.get("toto_2");
-        Integer toto_3 = (Integer) props.get("toto_3");
-        Integer toto_4 = (Integer) props.get("toto_4");
-        Integer gtoto = (Integer) props.get("gtoto");
-        Integer gtoto_2 = (Integer) props.get("gtoto_2");
-        Integer gtoto_3 = (Integer) props.get("gtoto_3");
-        Integer gtoto_4 = (Integer) props.get("gtoto_4");
-        assertEquals("Assert toto - 3 ("+toto.intValue()+")", toto.intValue(), 1);
-        assertEquals("Assert toto_2 - 3", toto_2.intValue(), 1);
-        assertEquals("Assert toto_3 - 3", toto_3.intValue(), 0);
-        assertEquals("Assert toto_4 - 3", toto_4.intValue(), 0);
-        assertEquals("Assert gtoto - 3 ("+gtoto.intValue()+")", gtoto.intValue(), 1);
-        assertEquals("Assert gtoto_2 - 3", gtoto_2.intValue(), 1);
-        assertEquals("Assert gtoto_3 - 3", gtoto_3.intValue(), 1);
-        assertEquals("Assert gtoto_4 - 3", gtoto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        Integer tata = (Integer) props.get("tata");
-        Integer tataStr = (Integer) props.get("tataStr");
-        Integer tataStrs = (Integer) props.get("tataStrs");
-        Integer tata_2 = (Integer) props.get("tata_2");
-        Integer tata_3 = (Integer) props.get("tata_3");
-        Integer tata1 = (Integer) props.get("tata1");
-        Integer tata1_1 = (Integer) props.get("tata1_1");
-        Integer tata5 = (Integer) props.get("tata5");
-        Integer tata5_1 = (Integer) props.get("tata5_1");
-        Integer tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 3", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 3", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 3", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 3", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 3", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 3", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 3", tata1_1.intValue(), 1);
-        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);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        gtoto = (Integer) props.get("gtoto");
-        gtoto_2 = (Integer) props.get("gtoto_2");
-        gtoto_3 = (Integer) props.get("gtoto_3");
-        gtoto_4 = (Integer) props.get("gtoto_4");
-        assertEquals("Assert toto - 4", toto.intValue(), 2);
-        assertEquals("Assert toto_2 - 4", toto_2.intValue(), 2);
-        assertEquals("Assert toto_3 - 4", toto_3.intValue(), 0);
-        assertEquals("Assert toto_4 - 4", toto_4.intValue(), 0);
-        assertEquals("Assert gtoto - 4 ("+gtoto.intValue()+")", gtoto.intValue(), 2);
-        assertEquals("Assert gtoto_2 - 4", gtoto_2.intValue(), 2);
-        assertEquals("Assert gtoto_3 - 4", gtoto_3.intValue(), 2);
-        assertEquals("Assert gtoto_4 - 4", gtoto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 4", tata.intValue(), 2);
-        assertEquals("Assert tataStr - 4", tataStr.intValue(), 2);
-        assertEquals("Assert tataStrs - 4", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 4", tata_2.intValue(), 2);
-        assertEquals("Assert tata_3 - 4", tata_3.intValue(), 2);
-        assertEquals("Assert tata1 - 4", tata1.intValue(), 2);
-        assertEquals("Assert tata1_1 - 4", tata1_1.intValue(), 2);
-        assertEquals("Assert tata5 - 4", tata5.intValue(), 2);
-        assertEquals("Assert tata5_1 - 4", tata5_1.intValue(), 2);
-        assertEquals("Assert tata5_2 - 4", tata5_2.intValue(), 2);
-
-        getContext().ungetService(ref);
-        tota = null;
-        
-        tataFactory.stop();
-        assertTrue("Assert under state - 5", under.getState() == ComponentInstance.INVALID);
-        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", getContext().getServiceReference(Tota.class.getName()));
-        ref = getContext().getServiceReference(Tota.class.getName());
-        tota = (Tota) getContext().getService(ref);
-        invokeAll(tota);
-        // Check toto
-        props = tota.getProps();
-        toto = (Integer) props.get("toto");
-        toto_2 = (Integer) props.get("toto_2");
-        toto_3 = (Integer) props.get("toto_3");
-        toto_4 = (Integer) props.get("toto_4");
-        gtoto = (Integer) props.get("gtoto");
-        gtoto_2 = (Integer) props.get("gtoto_2");
-        gtoto_3 = (Integer) props.get("gtoto_3");
-        gtoto_4 = (Integer) props.get("gtoto_4");
-        assertEquals("Assert toto - 6", toto.intValue(), 3);
-        assertEquals("Assert toto_2 - 6", toto_2.intValue(), 3);
-        assertEquals("Assert toto_3 - 6", toto_3.intValue(), 0);
-        assertEquals("Assert toto_4 - 6", toto_4.intValue(), 0);
-        assertEquals("Assert gtoto - 6 ("+gtoto.intValue()+")", gtoto.intValue(), 3);
-        assertEquals("Assert gtoto_2 - 6", gtoto_2.intValue(), 3);
-        assertEquals("Assert gtoto_3 - 6", gtoto_3.intValue(), 3);
-        assertEquals("Assert gtoto_4 - 6", gtoto_4.intValue(), 0);
-        //Check tata
-        props = tota.getPropsTata();
-        tata = (Integer) props.get("tata");
-        tataStr = (Integer) props.get("tataStr");
-        tataStrs = (Integer) props.get("tataStrs");
-        tata_2 = (Integer) props.get("tata_2");
-        tata_3 = (Integer) props.get("tata_3");
-        tata1 = (Integer) props.get("tata1");
-        tata1_1 = (Integer) props.get("tata1_1");
-        tata5 = (Integer) props.get("tata5");
-        tata5_1 = (Integer) props.get("tata5_1");
-        tata5_2 = (Integer) props.get("tata5_2");
-        assertEquals("Assert tata - 6", tata.intValue(), 1);
-        assertEquals("Assert tataStr - 6", tataStr.intValue(), 1);
-        assertEquals("Assert tataStrs - 6", tataStrs.intValue(), 0);
-        assertEquals("Assert tata_2 - 6", tata_2.intValue(), 1);
-        assertEquals("Assert tata_3 - 6", tata_3.intValue(), 1);
-        assertEquals("Assert tata1 - 6", tata1.intValue(), 1);
-        assertEquals("Assert tata1_1 - 6", tata1_1.intValue(), 1);
-        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);
-        getContext().ungetService(ref);
-        tota = null;
-        
-        // Is arch exposed
-        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(getContext(), Architecture.class.getName(), "ff"));
-        assertNull("Assert no tota service - 7", getContext().getServiceReference(Tota.class.getName()));
-        
-        under.dispose();
-        under = null;
-    }
-
-
-
-    private void invoke(Tota tota) {
-        tota.tata();
-        
-        assertEquals("Assert invoke tataint", tota.tataInt(2), 2);
-        assertEquals("Assert invoke tataLong", tota.tataLong(2), 2);
-        assertEquals("Assert invoke tataDouble", tota.tataDouble(2), 2);
-        assertEquals("Assert invoke tataChar", tota.tataChar('a'), 'a');
-        assertTrue("Assert invoke tataBoolean", tota.tataBoolean(true));
-        assertEquals("Assert invoke tataByte", tota.tataByte((byte)2), 2);
-        assertEquals("Assert invoke tataShort", tota.tataShort((short)5), 5);
-        assertEquals("Assert invoke tataFloat", tota.tataFloat(5), 5);
-        
-    }
-    
-    private void invokeArrays(Tota tota) {
-        
-        int[] a = new int[] {1,2,3};
-        assertEquals("Assert invoke tataint[]", tota.tataInts(a), a);
-        
-        long[] b = new long[] {1,2,3};
-        assertEquals("Assert invoke tataLong[]", tota.tataLongs(b), b);
-        
-        double[] c = new double[] {1,2,3};
-        assertEquals("Assert invoke tataDouble[]", tota.tataDoubles(c), c);
-        
-        char[] d = new char[] {'a','b', 'c'};
-        assertEquals("Assert invoke tataChar[]", tota.tataChars(d), d);
-        
-        boolean[] e = new boolean[] {true, false};
-        assertEquals("Assert invoke tataBoolean[]", tota.tataBooleans(e), e);
-        
-        byte[] f = new byte[] {(byte) 1};
-        assertEquals("Assert invoke tataByte[]", tota.tataBytes(f), f);
-        
-        short[] g = new short[] {(short) 1};
-        assertEquals("Assert invoke tataShort[]", tota.tataShorts(g), g);
-        
-        float[] h = new float[] {5,6,7};
-        assertEquals("Assert invoke tataFloat[]", tota.tataFloats(h), h);
-        
-    }
-    
-    private void invokeStr(Tota tota) {
-        tota.tataStr();
-    }
-    
-    private void invokeTata(Tota tota) {
-        tota.tata(1,2);
-        tota.tata("tototototo");
-    }
-    
-    private void invokeTata1(Tota tota) {
-        assertEquals("Assert tata1", tota.tata1("foo"), "foo");
-        assertEquals("Assert tata1 - 2", tota.tata1(new char[] {'a','b','c'}), "abc");
-    }
-    
-    private void invokeTata5(Tota tota) {
-        assertEquals("Assert tata5 -1", tota.tata5("foo",1), "foo"+1);
-        assertEquals("Assert tata5 - 2", tota.tata5(new String[] {"a","b","c"}, 1), "31");
-        assertEquals("Assert tata5 - 3", tota.tata5("foo", new int[] {1,2,3}), "foo3");
-    }
-    
-    private void invokeAdd(Tota tota) {
-        assertEquals("Assert add", tota.add(1,1,1), 3);
-    }
-    
-    private void invokeToto(Tota tota) {
-        tota.toto();
-        assertEquals("Assert toto", tota.toto("foo"), "foo");
-        tota.toto(1,2);
-    }
-    
-    private void invokeAll(Tota tota) {
-        invoke(tota);
-        invokeArrays(tota);
-        invokeStr(tota);
-        invokeTata(tota);
-        invokeTata1(tota);
-        invokeTata5(tota);
-        invokeAdd(tota);
-        invokeToto(tota);
-    }
-    
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java b/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
deleted file mode 100644
index 4f90fad..0000000
--- a/ipojo/tests/composite/service-providing/src/main/java/org/apache/felix/ipojo/test/composite/test/CompositeTest.java
+++ /dev/null
@@ -1,180 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.composite.test;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.composite.service.BazService;
-import org.apache.felix.ipojo.test.composite.service.CheckService;
-import org.apache.felix.ipojo.test.composite.service.FooService;
-import org.apache.felix.ipojo.test.composite.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class CompositeTest extends OSGiTestCase {
-	
-	public void testAPI() {
-		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty-1");
-		ComponentInstance empty = null;
-		try {
-			empty = fact1.createComponentInstance(p);
-		} catch(Exception e) {
-			e.printStackTrace();
-			fail(e.getMessage());
-		}
-		
-		ServiceContext sc = Utils.getServiceContext(empty);
-		
-		Factory fact2 = Utils.getFactoryByName(getContext(), "composite.test.2");
-		Properties props2 = new Properties();
-		props2.put("instance.name","2"); // 2
-		Factory fact3 = Utils.getFactoryByName(getContext(), "composite.test.3");
-		Properties props3 = new Properties();
-		props3.put("instance.name","3");
-		ComponentInstance comp2 = null;
-		ComponentInstance comp3 = null;
-		try {
-			comp2 = fact2.createComponentInstance(props2, sc);
-			comp3 = fact3.createComponentInstance(props3, sc);
-		} catch(Throwable e) {
-		    e.printStackTrace();
-		    fail(e.getMessage());
-		}
-		
-		assertTrue("Test comp3", comp3.getState() == ComponentInstance.VALID);
-		assertTrue("Test comp2", comp2.getState() == ComponentInstance.VALID);
-		
-		ServiceReference ref = null;
-
-		ref = Utils.getServiceReferenceByName(sc, CheckService.class.getName(), "2"); // 2
-
-		assertNotNull("Check ref", ref);
-		CheckService cs = (CheckService) sc.getService(ref);
-		assertTrue("Check invoke", cs.check());
-		
-		comp3.dispose();
-		comp2.dispose();
-		empty.dispose();
-	}
-	
-	public void testInstantiator() {
-		String type = "composite.instantiator";
-		Factory fact = Utils.getFactoryByName(getContext(), type);
-		ComponentInstance ci = null;
-		Properties p = new Properties();
-		p.put("instance.name","mon_coeur");
-		try {
-			ci = fact.createComponentInstance(p);
-		} catch(Exception e) {
-			e.printStackTrace();
-		}
-				
-		assertTrue("Check ci", ci.getState() == ComponentInstance.VALID);
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), BazService.class.getName(), "mon_coeur");
-		assertNotNull("Check ref",ref);
-		BazService bs = (BazService) getContext().getService(ref);
-		assertTrue("Check invocation", bs.foo());
-		getContext().ungetService(ref);
-		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "mon_coeur");
-		assertNotNull("Check ref 2 ",ref);
-		FooService fs = (FooService) getContext().getService(ref);
-		assertTrue("Check invocation", fs.foo());
-		getContext().ungetService(ref);
-		ci.dispose();
-	}
-	
-	public void testAPI2() {
-		Factory fact1 = Utils.getFactoryByName(getContext(), "composite.empty");
-		Properties p = new Properties();
-		p.put("instance.name","empty-2");
-		ComponentInstance empty = null;
-		try {
-			empty = fact1.createComponentInstance(p);
-		} catch(Exception e) {
-			e.printStackTrace();
-		}
-		
-		ServiceContext sc = Utils.getServiceContext(empty);
-		
-		Factory fact2 = Utils.getFactoryByName(sc, "composite.test.2");
-		Properties props2 = new Properties();
-		props2.put("instance.name","4");
-		Factory fact3 = Utils.getFactoryByName(sc, "composite.test.3");
-		Properties props3 = new Properties();
-		props3.put("instance.name","5");
-		ComponentInstance comp2 = null;
-		ComponentInstance comp3 = null;
-		try {
-			comp2 = fact2.createComponentInstance(props2, sc);
-			comp3 = fact3.createComponentInstance(props3, sc);
-		} catch(Exception e) {
-			e.printStackTrace();
-		}
-		
-		assertTrue("Test comp3", comp3.getState() == ComponentInstance.VALID);
-		assertTrue("Test comp2", comp2.getState() == ComponentInstance.VALID);
-		
-		ServiceReference ref = null;
-
-		ref = Utils.getServiceReferenceByName(sc, CheckService.class.getName(), "4");
-
-		assertNotNull("Check ref", ref);
-		CheckService cs = (CheckService) sc.getService(ref);
-		assertTrue("Check invoke", cs.check());
-		
-		comp3.dispose();
-		comp2.dispose();
-		empty.dispose();
-	}
-
-	
-	public void testApplication() {
-		Factory factory = Utils.getFactoryByName(getContext(), "composite.test.1");
-		ComponentInstance ci = null;
-		Properties props = new Properties();
-		props.put("instance.name","Test");
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch(Exception e) {
-			fail("Cannot instantiate Test " + e.getMessage());
-		}
-		
-		assertTrue("Check ci state", ci.getState() == ComponentInstance.VALID );
-		
-		ServiceReference[] refs = null;
-		try {
-			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) getContext().getService(refs[0]);
-		
-		assertTrue("Check invocation", cs.check());
-		ci.dispose();
-		
-	}
-
-}
diff --git a/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml b/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml
deleted file mode 100644
index 4df6a9e..0000000
--- a/ipojo/tests/composite/service-providing/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd 
-	    org.apache.felix.composite http://felix.apache.org/ipojo/schemas/SNAPSHOT/composite.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:comp="org.apache.felix.ipojo.composite">
-	<comp:composite name="composite.test.3" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			aggregate="true" filter="(factory.name=BazProviderType)" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService" />
-	</comp:composite>
-
-	<comp:composite name="composite.test.2" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.CheckService"
-			filter="(factory.name=Baz2CheckProvider)" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.CheckService" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			scope="composite" />
-	</comp:composite>
-
-	<comp:composite name="composite.test.1" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			filter="(factory.name=composite.test.3)" />
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.CheckService"
-			filter="(factory.name=composite.test.2)" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.CheckService" />
-	</comp:composite>
-
-	<comp:composite name="composite.instantiator" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService"
-			filter="(factory.name=composite.test.3)" />
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.BazService" />
-		<comp:provides action="export"
-			specification="org.apache.felix.ipojo.test.composite.service.FooService" />
-	</comp:composite>
-
-	<!-- Test composition provides -->
-
-	<comp:composite name="comp-0" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota" />
-	</comp:composite>
-
-	<comp:composite name="comp-1" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota">
-			<delegation method="tataInt" policy="One" />
-			<delegation method="toto1" policy="All" />
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-2" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata"
-			aggregate="true" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto"
-			aggregate="true" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota">
-			<delegation method="tataInt" policy="One" />
-			<delegation method="toto1" policy="All" />
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-3" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto"
-			optional="true" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota">
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-4" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto"
-			optional="true" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota">
-			<delegation method="tataInt" policy="One" />
-			<delegation method="toto1" policy="All" />
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-5" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata"
-			aggregate="true" />
-		<!-- <subservice action="import" specification="org.apache.felix.ipojo.test.comp:composite.service.Toto" aggregate ="true" optional="true"/> -->
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota">
-			<delegation method="tataInt" policy="One" />
-			<delegation method="toto1" policy="All" />
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-6" architecture="true">
-		<subservice action="instantiate"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata"
-			aggregate="true" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto"
-			aggregate="true" optional="true" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto">
-			<delegation method="toto1" policy="All" />
-		</comp:provides>
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tata">
-			<delegation method="tataInt" policy="One" />
-		</comp:provides>
-	</comp:composite>
-
-	<comp:composite name="comp-7" architecture="true">
-		<instance component="tata" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota" />
-	</comp:composite>
-
-	<comp:composite name="comp-8" architecture="true">
-		<instance component="tata" />
-		<instance component="totoglue" />
-		<subservice action="import"
-			specification="org.apache.felix.ipojo.test.composite.service.Toto" />
-		<comp:provides action="implement"
-			specification="org.apache.felix.ipojo.test.composite.service.Tota" />
-	</comp:composite>
-</ipojo>
diff --git a/ipojo/tests/core/annotations/pom.xml b/ipojo/tests/core/annotations/pom.xml
deleted file mode 100644
index d1a0a71..0000000
--- a/ipojo/tests/core/annotations/pom.xml
+++ /dev/null
@@ -1,147 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Annotations Test Suite</name>
-  <artifactId>tests.core.annotations</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>1.6.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-    <groupId>org.osgi</groupId>
-    <artifactId>org.osgi.compendium</artifactId>
-    <version>4.0.0</version>
-  </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
-      <version>${ipojo.eah.snapshot}</version>
-    </dependency>
-
-     <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.eventadmin</artifactId>
-      <version>1.0.0</version>
-      <scope>test</scope>
-    </dependency>
-
-  </dependencies>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.annotations.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*, foo
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.annotations.AnnotationsTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-
-       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/annotations/src/main/java/foo/Foo.java b/ipojo/tests/core/annotations/src/main/java/foo/Foo.java
deleted file mode 100644
index aa8d383..0000000
--- a/ipojo/tests/core/annotations/src/main/java/foo/Foo.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package foo;
-
-
-/**
- * Creates a simple annotation to create the processing of non-matching
- * annotations
- */
-public @interface Foo {
-    String bar();
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/foo/RGB.java b/ipojo/tests/core/annotations/src/main/java/foo/RGB.java
deleted file mode 100644
index ec43bc7..0000000
--- a/ipojo/tests/core/annotations/src/main/java/foo/RGB.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package foo;
-
-/**
- * Checks the enum support in custom handler.
- */
-public enum RGB {
-
-    RED, GREEN, BLUE
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/foo/ipojo/IPOJOFoo.java b/ipojo/tests/core/annotations/src/main/java/foo/ipojo/IPOJOFoo.java
deleted file mode 100644
index 553ae17..0000000
--- a/ipojo/tests/core/annotations/src/main/java/foo/ipojo/IPOJOFoo.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package foo.ipojo;
-
-
-import foo.RGB;
-
-/**
- * Creates a simple annotation to create the processing of matching
- * annotations
- */
-public @interface IPOJOFoo {
-    String bar();
-
-    RGB rgb() default RGB.BLUE;
-
-    RGB[] colors() default {};
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
deleted file mode 100644
index 5aa2568..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AggregateDependency.java
+++ /dev/null
@@ -1,81 +0,0 @@
-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;
-
-public class AggregateDependency extends OSGiTestCase {
-    
-    private Element[] deps;
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.AggregateDependency");
-        deps = meta.getElements("requires");
-    }
-    
-    
-    public void testCallbackBind() {
-        Element dep = getDependencyById(deps, "Bar");
-        String opt = dep.getAttribute("aggregate");
-        assertEquals("Check aggregate", "true", opt);
-    }
-    
-    public void testCallbackUnbind() {
-        Element dep = getDependencyById(deps, "Baz");
-        String opt = dep.getAttribute("aggregate");
-        assertEquals("Check aggregate", "true", opt);
-    }
-    
-    public void testBindOnly() {
-        Element dep = getDependencyById(deps, "bindonly");
-        String opt = dep.getAttribute("aggregate");
-        assertEquals("Check aggregate", "true", opt);
-    }
-    
-    public void testUnbindOnly() {
-        Element dep = getDependencyById(deps, "unbindonly");
-        String opt = dep.getAttribute("aggregate");
-        assertEquals("Check aggregate", "true", opt);
-    }
-    
-
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        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;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
deleted file mode 100644
index 3d7f922..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/AnnotationsTestSuite.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class AnnotationsTestSuite extends TestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Annotations Test Suite", bc);
-        ots.addTestSuite(ServiceProdiving.class);
-        ots.addTestSuite(LifecycleController.class);
-        ots.addTestSuite(LifecycleCallbacks.class);
-        ots.addTestSuite(Properties.class);
-        ots.addTestSuite(Architecture.class);
-        ots.addTestSuite(Factory.class);
-        ots.addTestSuite(Dependency.class);
-        ots.addTestSuite(OptionalDependency.class);
-        ots.addTestSuite(AggregateDependency.class);
-        ots.addTestSuite(PolicyDependency.class);
-        ots.addTestSuite(FilteredDependency.class);
-        ots.addTestSuite(RankedDependency.class);
-
-        // External handler annotations
-        ots.addTestSuite(TemporalDependencies.class);
-        ots.addTestSuite(JMX.class);
-        ots.addTestSuite(WhiteBoard.class);
-        ots.addTestSuite(Extender.class);
-        ots.addTestSuite(EventAdmin.class);
-
-        ots.addTestSuite(CustomAnnotations.class);
-
-        // Instantiate
-        ots.addTestSuite(Instantiate.class);
-
-        return ots;
-    }
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
deleted file mode 100644
index 9996972..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Architecture.java
+++ /dev/null
@@ -1,34 +0,0 @@
-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;
-
-public class Architecture extends OSGiTestCase {
-    
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    
-    public void testArch() {
-        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 = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoArch");
-        String arch = meta.getAttribute("architecture");
-        assertNotNull("Architecture exists ", arch);
-        assertEquals("Architecture value", "false", arch);
-    }
-    
-    
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/CustomAnnotations.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/CustomAnnotations.java
deleted file mode 100644
index 9e852cd..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/CustomAnnotations.java
+++ /dev/null
@@ -1,39 +0,0 @@
-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;
-
-/**
- * Checks the support of the custom annotation handlinig.
- */
-public class CustomAnnotations extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void testThatCustomAnnotationAreCorrectlyAdded() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.CustomAnnotationWithEnum");
-        Element[] ann = meta.getElements("IPOJOFoo", "foo.ipojo");
-        assertNotNull("Annotation exists ", ann);
-    }
-
-    public void testThatCustomAnnotationAreSupportingEnums() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.CustomAnnotationWithEnum");
-        Element[] ann = meta.getElements("IPOJOFoo", "foo.ipojo");
-        assertNotNull("Annotation exists ", ann);
-        Element element = ann[0];
-        // Simple value
-        assertEquals("RED", element.getAttribute("rgb"));
-        // Array (FELIX-3508).
-        assertEquals("{BLUE,RED}", element.getAttribute("colors"));
-    }
-
-    
-    
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
deleted file mode 100644
index 2bd64dc..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Dependency.java
+++ /dev/null
@@ -1,137 +0,0 @@
-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;
-
-public class Dependency extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void testDependencyDeclaration() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.Dependency");
-        Element[] deps = meta.getElements("requires");
-        
-        // Check fs
-        Element dep = getDependencyById(deps, "fs");
-        String field = dep.getAttribute("field");
-        String id = dep.getAttribute("id");
-        String bind = getBind(dep);
-        String unbind = getUnbind(dep);
-        assertNotNull("Check fs field", field);
-        assertEquals("Check fs field", "fs", field);
-        assertNull("Check fs bind", bind);
-        assertNull("Check fs unbind", unbind);
-        assertNull("Check fs id", id);
-        
-        // Check bar
-        dep = getDependencyById(deps, "Bar");
-        field = dep.getAttribute("field");
-        id = dep.getAttribute("id");
-        bind = getBind(dep);
-        unbind = getUnbind(dep);
-        assertNull("Check bar field", field);
-        assertEquals("Check bar bind", "bindBar", bind);
-        assertEquals("Check bar unbind", "unbindBar", unbind);
-        assertEquals("Check bar id", "Bar", id);
-        
-        // Check baz
-        dep = getDependencyById(deps, "Baz");
-        field = dep.getAttribute("field");
-        id = dep.getAttribute("id");
-        bind = getBind(dep);
-        unbind = getUnbind(dep);
-        assertNull("Check baz field", field);
-        assertEquals("Check baz bind", "bindBaz", bind);
-        assertEquals("Check baz unbind", "unbindBaz", unbind);
-        assertEquals("Check baz id", "Baz", id);
-        
-        // Check fs2
-        dep = getDependencyById(deps, "fs2");
-        field = dep.getAttribute("field");
-        id = dep.getAttribute("id");
-        bind = getBind(dep);
-        unbind = getUnbind(dep);
-        assertNotNull("Check fs2 field", field);
-        assertEquals("Check fs2 field", "fs2", field);
-        assertEquals("Check fs2 bind", "bindFS2", bind);
-        assertEquals("Check fs2 unbind", "unbindFS2", unbind);
-        
-        // Check fs2inv
-        dep = getDependencyById(deps, "fs2inv");
-        field = dep.getAttribute("field");
-        id = dep.getAttribute("id");
-        bind = getBind(dep);
-        unbind = getUnbind(dep);
-        assertNotNull("Check fs2inv field", field);
-        assertEquals("Check fs2 field", "fs2inv", field);
-        assertEquals("Check fs2 bind", "bindFS2Inv", bind);
-        assertEquals("Check fs2 unbind", "unbindFS2Inv", unbind);
-        assertEquals("Check fs2 id", "inv", id);
-        
-        // Check mod
-        dep = getDependencyById(deps, "mod");
-        id = dep.getAttribute("id");
-        bind = getBind(dep);
-        unbind = getUnbind(dep);
-        String mod = getModified(dep);
-        assertEquals("Check mod bind", "bindMod", bind);
-        assertEquals("Check mod unbind", "unbindMod", unbind);
-        assertEquals("Check mod modified", "modifiedMod", mod);
-        assertEquals("Check mod id", "mod", id);
-        
-        // Check not proxied
-        dep = getDependencyById(deps, "notproxied");
-        assertEquals("Check not proxied", "false", dep.getAttribute("proxy"));
-    }
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        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;
-    }
-    
-    private String getModified(Element dep) {
-        Element[] elem = dep.getElements("callback");
-        for (int i = 0; elem != null && i < elem.length; i++) {
-            if (elem[i].getAttribute("type").equalsIgnoreCase("modified")) {
-                return elem[i].getAttribute("method");
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
deleted file mode 100644
index 0993fa0..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/EventAdmin.java
+++ /dev/null
@@ -1,249 +0,0 @@
-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;
-
-public class EventAdmin extends OSGiTestCase {
-    String type = "org.apache.felix.ipojo.test.scenarios.component.event.PubSub";
-    String deprecated = "org.apache.felix.ipojo.test.scenarios.component.event.PubSubDeprecated";
-    String publishes = "org.apache.felix.ipojo.test.scenarios.component.event.PubSubWithPublishes";
-
-    String namespace = "org.apache.felix.ipojo.handlers.event";
-
-    Element component;
-    Element componentDeprecated;
-    Element componentWithPublishes;
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        component = helper.getMetadata(type);
-        componentDeprecated = helper.getMetadata(deprecated);
-        componentWithPublishes = helper.getMetadata(publishes);
-        assertNotNull("Check component", component);
-        assertNotNull("Check deprecated", componentDeprecated);
-        assertNotNull("Check publishes", componentWithPublishes);
-
-    }
-
-    public void tearDown() {
-        component = null;
-        componentDeprecated = null;
-        componentWithPublishes = null;
-    }
-
-    public void testP1() {
-        //P1, synchronous
-        Element elem = getElementByName("p1");
-        checkPublisher(elem);
-        assertNull("Check topics", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher1", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("dataKey"));
-    }
-
-    public void testP1WithPublishes() {
-        //P1, synchronous
-        Element elem = getPublishesByName("p1");
-        checkPublishes(elem);
-        assertNull("Check topics", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher1", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("dataKey"));
-    }
-
-    public void testP1Deprecated() {
-        //P1, synchronous
-        Element elem = getDeprecatedElementByName("p1");
-        checkPublisher(elem);
-        assertNull("Check topics", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher1", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("data_key"));
-    }
-
-    public void testP2() {
-        //name="p2", synchronous=false, topics="foo,bar", data_key="data"
-        Element elem = getElementByName("p2");
-        checkPublisher(elem);
-        assertEquals("Check topics (" + elem.getAttribute("topics")+")", "foo,bar", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "false", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher2", elem.getAttribute("field"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("dataKey"));
-    }
-
-    public void testP2WithPublishes() {
-        //name="p2", synchronous=false, topics="foo,bar", data_key="data"
-        Element elem = getPublishesByName("p2");
-        checkPublishes(elem);
-        assertEquals("Check topics (" + elem.getAttribute("topics")+")", "foo,bar", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "false", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher2", elem.getAttribute("field"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("dataKey"));
-    }
-
-    public void testP2Deprecated() {
-        //name="p2", synchronous=false, topics="foo,bar", data_key="data"
-        Element elem = getDeprecatedElementByName("p2");
-        checkPublisher(elem);
-        assertEquals("Check topics (" + elem.getAttribute("topics")+")", "foo,bar", elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "false", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher2", elem.getAttribute("field"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
-    }
-
-    public void testP3() {
-        //name="p3", synchronous=true, topics="bar"
-        Element elem = getElementByName("p3");
-        checkPublisher(elem);
-        assertEquals("Check topics", "bar" ,elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher3", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("dataKey"));
-    }
-
-    public void testWithPublishesP3() {
-        //name="p3", synchronous=true, topics="bar"
-        Element elem = getPublishesByName("p3");
-        checkPublishes(elem);
-        assertEquals("Check topics", "bar" ,elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher3", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("dataKey"));
-    }
-
-    public void testP3Deprecated() {
-        //name="p3", synchronous=true, topics="bar"
-        Element elem = getDeprecatedElementByName("p3");
-        checkPublisher(elem);
-        assertEquals("Check topics", "bar" ,elem.getAttribute("topics"));
-        assertEquals("Check synchronous", "true", elem.getAttribute("synchronous"));
-        assertEquals("Check field", "publisher3", elem.getAttribute("field"));
-        assertNull("Check data_key", elem.getAttribute("data_key"));
-    }
-
-    public void testS1() {
-        //name="s1", data_key="data"
-        Element elem = getElementByName("s1");
-        checkSubscriber(elem);
-        assertNull("Check topics",elem.getAttribute("topics"));
-        assertEquals("Check method", "receive1", elem.getAttribute("method"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("dataKey"));
-        assertNull("Check data_type", elem.getAttribute("dataType"));
-        assertNull("Check filter", elem.getAttribute("filter"));
-    }
-
-    public void testS1Deprecated() {
-        //name="s1", data_key="data"
-        Element elem = getDeprecatedElementByName("s1");
-        checkSubscriber(elem);
-        assertNull("Check topics",elem.getAttribute("topics"));
-        assertEquals("Check method", "receive1", elem.getAttribute("method"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
-        assertNull("Check data_type", elem.getAttribute("data_type"));
-        assertNull("Check filter", elem.getAttribute("filter"));
-    }
-
-    public void testS2() {
-        //name="s2", topics="foo,bar", filter="(foo=true)"
-        Element elem = getElementByName("s2");
-        checkSubscriber(elem);
-        assertEquals("Check topics", "foo,bar", elem.getAttribute("topics"));
-        assertEquals("Check method", "receive2", elem.getAttribute("method"));
-        assertNull("Check data_key" ,elem.getAttribute("dataKey"));
-        assertNull("Check data_type", elem.getAttribute("dataType"));
-        assertEquals("Check filter","(foo=true)" , elem.getAttribute("filter"));
-    }
-
-    public void testS2Deprecated() {
-        //name="s2", topics="foo,bar", filter="(foo=true)"
-        Element elem = getDeprecatedElementByName("s2");
-        checkSubscriber(elem);
-        assertEquals("Check topics", "foo,bar", elem.getAttribute("topics"));
-        assertEquals("Check method", "receive2", elem.getAttribute("method"));
-        assertNull("Check data_key" ,elem.getAttribute("data_key"));
-        assertNull("Check data_type", elem.getAttribute("data_type"));
-        assertEquals("Check filter","(foo=true)" , elem.getAttribute("filter"));
-    }
-
-    public void testS3() {
-        //name="s3", topics="foo", data_key="data", data_type="java.lang.String"
-        Element elem = getElementByName("s3");
-        checkSubscriber(elem);
-        assertEquals("Check topics", "foo", elem.getAttribute("topics"));
-        assertEquals("Check method", "receive3", elem.getAttribute("method"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("dataKey"));
-        assertEquals("Check data_type", "java.lang.String", elem.getAttribute("dataType"));
-        assertNull("Check filter", elem.getAttribute("filter"));
-    }
-
-    public void testS3Deprecated() {
-        //name="s3", topics="foo", data_key="data", data_type="java.lang.String"
-        Element elem = getDeprecatedElementByName("s3");
-        checkSubscriber(elem);
-        assertEquals("Check topics", "foo", elem.getAttribute("topics"));
-        assertEquals("Check method", "receive3", elem.getAttribute("method"));
-        assertEquals("Check data_key", "data" ,elem.getAttribute("data_key"));
-        assertEquals("Check data_type", "java.lang.String", elem.getAttribute("data_type"));
-        assertNull("Check filter", elem.getAttribute("filter"));
-    }
-
-
-
-    public Element getElementByName(String name) {
-        Element [] elems = component.getElements();
-        for (int i = 0; i < elems.length; i++) {
-            if (elems[i].containsAttribute("name") && elems[i].getAttribute("name").equals(name)) {
-                return elems[i];
-            }
-        }
-        return null;
-    }
-
-    public Element getPublishesByName(String name) {
-        Element [] elems = componentWithPublishes.getElements();
-        for (int i = 0; i < elems.length; i++) {
-            if (elems[i].containsAttribute("name") && elems[i].getAttribute("name").equals(name)) {
-                return elems[i];
-            }
-        }
-        return null;
-    }
-
-    public Element getDeprecatedElementByName(String name) {
-        Element [] elems = componentDeprecated.getElements();
-        for (int i = 0; i < elems.length; i++) {
-            if (elems[i].containsAttribute("name") && elems[i].getAttribute("name").equals(name)) {
-                return elems[i];
-            }
-        }
-        return null;
-    }
-
-    public void checkSubscriber(Element elem) {
-        assertNotNull("Can't check subscriber : null element",elem);
-        String ns = elem.getNameSpace();
-        String nm = elem.getName();
-        assertEquals("Elem is not a subscriber : bad namespace", namespace, ns);
-        assertEquals("Elem is not a subscriber : bad name", "subscriber", nm);
-
-    }
-
-    public void checkPublisher(Element elem) {
-        assertNotNull("Can't check publisher : null element",elem);
-        String ns = elem.getNameSpace();
-        String nm = elem.getName();
-        assertEquals("Elem is not a publisher : bad namespace", namespace, ns);
-        assertEquals("Elem is not a publisher : bad name", "publisher", nm);
-    }
-
-    public void checkPublishes(Element elem) {
-        assertNotNull("Can't check publisher : null element",elem);
-        String ns = elem.getNameSpace();
-        String nm = elem.getName();
-        assertEquals("Elem is not a publisher : bad namespace", namespace, ns);
-        assertEquals("Elem is not a publisher : bad name", "publishes", nm);
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
deleted file mode 100644
index 9f8a418..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Extender.java
+++ /dev/null
@@ -1,32 +0,0 @@
-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;
-
-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 = helper.getMetadata(type);
-        assertNotNull("Check meta", meta);
-        Element[] ext = meta.getElements("extender", namespace);
-        assertEquals("Check size", 1, ext.length);
-        String extension = ext[0].getAttribute("extension");
-        String onArr = ext[0].getAttribute("onArrival");
-        String onDep = ext[0].getAttribute("onDeparture");
-        
-        assertEquals("Check extension", "foo", extension);
-        assertEquals("Check onArrival", "onArrival", onArr);
-        assertEquals("Check onDeparture", "onDeparture", onDep);
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
deleted file mode 100644
index 0d696d1..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Factory.java
+++ /dev/null
@@ -1,75 +0,0 @@
-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;
-
-public class Factory extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testArchDeprecated() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FactoryDeprecated");
-        String fact = meta.getAttribute("public");
-        String name = meta.getAttribute("name");
-        assertNotNull("Factory exists ", fact);
-        assertEquals("Factory value", "true", fact);
-        assertNotNull("Name exists ", name);
-        assertEquals("Name value", "org.apache.felix.ipojo.test.scenarios.component.FactoryDeprecated", name);
-    }
-
-    public void testArch() {
-        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);
-        assertEquals("Factory value", "true", fact);
-        assertNotNull("Name exists ", name);
-        assertEquals("Name value", "factory", name);
-    }
-
-    public void testNoArch() {
-        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);
-        assertEquals("Factory value", "false", fact);
-        assertNotNull("Name exists ", name);
-        assertEquals("Name value", "nofactory", name);
-    }
-
-    public void testFactoryMethod() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FactoryMethod");
-        String method = meta.getAttribute("factory-method");
-        assertNotNull("Method exists ", method);
-        assertEquals("Method value", "create", method);
-    }
-
-    public void testFactoryMethodDeprecated() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FactoryMethodDeprecated");
-        String method = meta.getAttribute("factory-method");
-        assertNotNull("Method exists ", method);
-        assertEquals("Method value", "create", method);
-    }
-
-    public void testVersion() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ComponentTypeVersion");
-        String version = meta.getAttribute("version");
-        assertNotNull("Version exist", version);
-        assertEquals("Version value", "1.0.0", version);
-    }
-
-    public void testNoVersion() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FactoryMethod");
-        String version = meta.getAttribute("version");
-        assertNull("No Version", version);
-    }
-
-
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
deleted file mode 100644
index 8db422c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/FilteredDependency.java
+++ /dev/null
@@ -1,100 +0,0 @@
-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;
-
-public class FilteredDependency extends OSGiTestCase {
-    
-    private Element[] deps ;
-    private Element[] froms;
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FilteredDependency");
-        deps = meta.getElements("requires");
-        
-        Element meta2 = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.FromDependency");
-        froms = meta2.getElements("requires");
-    }
-    
-    public void testField() {
-        Element dep = getDependencyById(deps, "fs");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testCallbackBind() {
-        Element dep = getDependencyById(deps, "Bar");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testCallbackUnbind() {
-        Element dep = getDependencyById(deps, "Baz");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testBoth() {
-        Element dep = getDependencyById(deps, "inv");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testBindOnly() {
-        Element dep = getDependencyById(deps, "bindonly");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testUnbindOnly() {
-        Element dep = getDependencyById(deps, "unbindonly");
-        String opt = dep.getAttribute("filter");
-        assertEquals("Check filter", "(foo=bar)", opt);
-    }
-    
-    public void testFromField() {
-        Element dep = getDependencyById(froms, "fs");
-        String from = dep.getAttribute("from");
-        assertEquals("Check from", "X", from);
-    }
-    
-    public void testFromBind() {
-        Element dep = getDependencyById(froms, "fs2");
-        String from = dep.getAttribute("from");
-        assertEquals("Check from", "X", from);
-    }
-    
-    public void testFromUnbind() {
-        Element dep = getDependencyById(froms, "inv");
-        String from = dep.getAttribute("from");
-        assertEquals("Check from", "X", from);
-    }
-    
-    public void testNoFrom() {
-        Element dep = getDependencyById(froms, "Bar");
-        String from = dep.getAttribute("from");
-        assertNull("Check from", from);
-    }
-
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        fail("Dependency  " + name + " not found");
-        return null;
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Instantiate.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Instantiate.java
deleted file mode 100644
index 67c2e8f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Instantiate.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.annotations;
-
-import java.util.ArrayList;
-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.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class Instantiate extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testInstantiateSimple() {
-        Element[] meta = getInstanceMetadata(context.getBundle(), "org.apache.felix.ipojo.test.scenarios.component.InstantiateSimple");
-        assertNotNull(meta);
-        assertEquals(1, meta.length);
-        assertNull(meta[0].getAttribute("name"));
-        assertEquals(0, meta[0].getElements().length);
-    }
-    
-    public void testInstantiateWithName() {
-        // Check instance tag
-        Element[] meta = getInstanceMetadata(context.getBundle(), "org.apache.felix.ipojo.test.scenarios.component.InstantiateWithName");
-        assertNotNull(meta);
-        assertEquals(1, meta.length);
-        assertNotNull(meta[0].getAttribute("name"));
-        assertEquals("myInstantiatedInstance", meta[0].getAttribute("name"));
-        assertEquals(0, meta[0].getElements().length);
-    }
-    
-    public void testInstanceCreation() throws InvalidSyntaxException {
-        String in = "org.apache.felix.ipojo.test.scenarios.component.InstantiateSimple-0";
-        ServiceReference ref = helper.getServiceReferenceByName(org.apache.felix.ipojo.architecture.Architecture.class.getName(), 
-                in);
-        assertNotNull(ref);
-    }
-    
-    public void testInstanceCreationWithName() {
-        String in = "myInstantiatedInstance";
-        ServiceReference ref = helper.getServiceReferenceByName(org.apache.felix.ipojo.architecture.Architecture.class.getName(), 
-                in);
-        assertNotNull(ref);
-    }
-
-    /**
-     * 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<Element> list = new ArrayList<Element>();
-        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());
-        }
-    }
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
deleted file mode 100644
index 7da4390..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/JMX.java
+++ /dev/null
@@ -1,67 +0,0 @@
-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;
-
-public class JMX extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testDeprecated() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.jmx.JMXDeprecated");
-        /*
-         * 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"
-        org.apache.felix.ipojo.handlers.jmx:method description="get the foo prop" method="getFoo"
-        org.apache.felix.ipojo.handlers.jmx:method description="set the foo prop" method="setFoo"
-         */
-
-        Element[] ele = meta.getElements("config", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("ele not null", ele);
-        assertEquals("Ele size", 1, ele.length);
-        String domain = ele[0].getAttribute("domain");
-        String mosgi = ele[0].getAttribute("usesmosgi");
-        assertEquals("domain", "my-domain", domain);
-        assertEquals("mosgi", "false", mosgi);
-
-        Element[] props = ele[0].getElements("property", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("props not null", props);
-        assertEquals("props size", 1, props.length);
-
-        Element[] methods = ele[0].getElements("method", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("methods not null", methods);
-        assertEquals("methods size", 2, methods.length);
-    }
-
-    public void test() {
-        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"
-        org.apache.felix.ipojo.handlers.jmx:method description="get the foo prop" method="getFoo"
-        org.apache.felix.ipojo.handlers.jmx:method description="set the foo prop" method="setFoo"
-         */
-
-        Element[] ele = meta.getElements("config", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("ele not null", ele);
-        assertEquals("Ele size", 1, ele.length);
-        String domain = ele[0].getAttribute("domain");
-        String mosgi = ele[0].getAttribute("usesmosgi");
-        assertEquals("domain", "my-domain", domain);
-        assertEquals("mosgi", "false", mosgi);
-
-        Element[] props = ele[0].getElements("JMXProperty", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("props not null", props);
-        assertEquals("props size", 1, props.length);
-
-        Element[] methods = ele[0].getElements("JMXMethod", "org.apache.felix.ipojo.handlers.jmx");
-        assertNotNull("methods not null", methods);
-        assertEquals("methods size", 2, methods.length);
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
deleted file mode 100644
index 554de91..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleCallbacks.java
+++ /dev/null
@@ -1,55 +0,0 @@
-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;
-
-public class LifecycleCallbacks extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void testCallbacks() {
-        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);
-        
-        Element elem = getCallbackByMethodName(cbs, "start");
-        assertEquals("Check start method", "start", elem.getAttribute("method"));
-        assertEquals("Check start transition", "validate", elem.getAttribute("transition"));
-        
-        elem = getCallbackByMethodName(cbs, "stop");
-        assertEquals("Check stop method", "stop", elem.getAttribute("method"));
-        assertEquals("Check stop transition", "invalidate", elem.getAttribute("transition"));
-    }
-    
-    public void testImmediate() {
-        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 = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.NoImmediate");
-        assertNotNull("Immediate attribute", meta.getAttribute("immediate"));
-        assertEquals("Immediate attribute value", "false", meta.getAttribute("immediate"));
-    }
-    
-    private Element getCallbackByMethodName(Element[] cbs, String method) {
-        for (int i = 0; i < cbs.length; i++) {
-            String met = cbs[i].getAttribute("method");
-            if (met != null && met.equalsIgnoreCase(method)) {
-                return cbs[i];
-            }
-        }
-        fail("Cannot found the callback with the method " + method);
-        return null;
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
deleted file mode 100644
index 95a60ac..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/LifecycleController.java
+++ /dev/null
@@ -1,27 +0,0 @@
-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;
-
-public class LifecycleController extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void testLFC() {
-        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];
-        assertNotNull("Field", ctrl.getAttribute("field"));
-        assertEquals("Field", "lfc", ctrl.getAttribute("field"));
-    }
-    
-    
-
-}
-
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
deleted file mode 100644
index 7e9b970..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/OptionalDependency.java
+++ /dev/null
@@ -1,105 +0,0 @@
-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;
-
-public class OptionalDependency extends OSGiTestCase {
-    
-    private Element[] deps ;
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.OptionalDependency");
-        deps = meta.getElements("requires");
-    }
-    
-    public void testField() {
-        Element dep = getDependencyById(deps, "fs");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testFieldNoOptional() {
-        Element dep = getDependencyById(deps, "fs2");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "false", opt);
-    }
-    
-    public void testCallbackBind() {
-        Element dep = getDependencyById(deps, "Bar");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testCallbackUnbind() {
-        Element dep = getDependencyById(deps, "Baz");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testBoth() {
-        Element dep = getDependencyById(deps, "inv");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testBindOnly() {
-        Element dep = getDependencyById(deps, "bindonly");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testUnbindOnly() {
-        Element dep = getDependencyById(deps, "unbindonly");
-        String opt = dep.getAttribute("optional");
-        assertEquals("Check optionality", "true", opt);
-    }
-    
-    public void testNullable() {
-        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");
-        assertNotNull("Check nullable", nullable);
-        assertEquals("Check nullable value", "true", nullable);
-    }
-    
-    public void testNoNullable() {
-        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");
-        assertNotNull("Check nullable", nullable);
-        assertEquals("Check nullable value", "false", nullable);
-    }
-    
-    public void testDefaultImplmentation() {
-        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");
-        assertNotNull("Check DI", di);
-        assertEquals("Check DI value", ProvidesSimple.class.getName(), di);
-    }
-    
-
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        fail("Dependency  " + name + " not found");
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
deleted file mode 100644
index 0850190..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/PolicyDependency.java
+++ /dev/null
@@ -1,77 +0,0 @@
-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;
-
-public class PolicyDependency extends OSGiTestCase {
-    
-    private Element[] deps ;
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PolicyDependency");
-        deps = meta.getElements("requires");
-    }
-    
-    public void testField() {
-        Element dep = getDependencyById(deps, "fs");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-    public void testFieldDPpolicy() {
-        Element dep = getDependencyById(deps, "fs2");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "dynamic-priority", opt);
-    }
-    
-    public void testCallbackBind() {
-        Element dep = getDependencyById(deps, "Bar");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-    public void testCallbackUnbind() {
-        Element dep = getDependencyById(deps, "Baz");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-    public void testBoth() {
-        Element dep = getDependencyById(deps, "inv");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-    public void testBindOnly() {
-        Element dep = getDependencyById(deps, "bindonly");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-    public void testUnbindOnly() {
-        Element dep = getDependencyById(deps, "unbindonly");
-        String opt = dep.getAttribute("policy");
-        assertEquals("Check policy", "static", opt);
-    }
-    
-
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        fail("Dependency  " + name + " not found");
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
deleted file mode 100644
index 6bd310d..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/Properties.java
+++ /dev/null
@@ -1,166 +0,0 @@
-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;
-
-public class Properties extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void testProperties() {
-        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];
-        Element[] props = prov.getElements("property");
-        assertEquals("Number of properties", props.length, 5);
-        //Foo
-        Element foo = getPropertyByName(props, "foo");
-        assertEquals("Check foo field", "m_foo", foo.getAttribute("field"));
-        assertEquals("Check foo name", "foo", foo.getAttribute("name"));
-        //Bar
-        Element bar = getPropertyByName(props, "bar");
-        assertEquals("Check bar field", "bar", bar.getAttribute("field"));
-        assertEquals("Check bar value", "4", bar.getAttribute("value"));
-        //Boo
-        Element boo = getPropertyByName(props, "boo");
-        assertEquals("Check boo field", "boo", boo.getAttribute("field"));
-        assertEquals("Check boo method", "setboo", boo.getAttribute("method"));
-        //Baa
-        Element baa = getPropertyByName(props, "baa");
-        assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));
-        assertEquals("Check baa name", "baa", baa.getAttribute("name"));
-        assertEquals("Check baa method", "setbaa", baa.getAttribute("method"));
-        assertEquals("Check mandatory", "true", baa.getAttribute("mandatory"));
-
-        
-        //Bar
-        Element baz = getPropertyByName(props, "baz");
-        assertEquals("Check baz method", "setbaz", baz.getAttribute("method"));
-        assertEquals("Check baz name", "baz", baz.getAttribute("name"));
-    }
-    
-    public void testAbsentPropagation() {
-        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];
-        String att = prov.getAttribute("propagation");
-        assertNull("Propagation", att);
-    }
-    
-    public void testPropagation() {
-        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];
-        String att = prov.getAttribute("propagation");
-        assertNotNull("Propagation", att);
-        assertEquals("Propagation value", "true", att);
-    }
-    
-    public void testNoPropagation() {
-        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];
-        String att = prov.getAttribute("propagation");
-        assertNotNull("Propagation", att);
-        assertEquals("Propagation value", "false", att);
-    }
-    
-    public void testPID() {
-        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];
-        String att = prov.getAttribute("pid");
-        assertNotNull("PID", att);
-        assertEquals("PID Value", "MyPID", att);
-    }
-    
-    public void testAbsentPID() {
-        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];
-        String att = prov.getAttribute("pid");
-        assertNull("PID", att);
-    }
-    
-    public void testPropagationAndPID() {
-        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];
-        String att = prov.getAttribute("pid");
-        assertNotNull("PID", att);
-        assertEquals("PID Value", "MyPID", att);
-        att = prov.getAttribute("propagation");
-        assertNotNull("Propagation", att);
-        assertEquals("Propagation value", "true", att);
-    }
-    
-    public void testPIDAndPropagation() {
-        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];
-        String att = prov.getAttribute("pid");
-        assertNotNull("PID", att);
-        assertEquals("PID Value", "MyPID", att);
-        att = prov.getAttribute("propagation");
-        assertNotNull("Propagation", att);
-        assertEquals("Propagation value", "true", att);
-    }
-    
-    public void testUpdatedAndPID() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.UpdatedWithManagedService");
-        Element[] provs = meta.getElements("properties");
-        assertNotNull("Properties exists ", provs);
-        Element prov = provs[0];
-        String att = prov.getAttribute("pid");
-        assertNotNull("PID", att);
-        assertEquals("PID Value", "MyPID", att);
-        
-        att = prov.getAttribute("updated");
-        assertNotNull("att", att);
-        assertEquals("Updated Value", "after", att);
-    }
-    
-    public void testUpdatedAndProperties() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.UpdatedWithProperties");
-        Element[] provs = meta.getElements("properties");
-        assertNotNull("Properties exists ", provs);
-        Element prov = provs[0];
-        String att = prov.getAttribute("pid");
-        assertNull("PID", att);
-        
-        att = prov.getAttribute("updated");
-        assertNotNull("att", att);
-        assertEquals("Updated Value", "after", att);
-    }
-    
-    private Element getPropertyByName(Element[] props, String name) {
-        for (int i = 0; i < props.length; i++) {
-            String na = props[i].getAttribute("name");
-            String field = props[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return props[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return props[i];
-            }
-        }
-        fail("Property  " + name + " not found");
-        return null;
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
deleted file mode 100644
index 6ddb3fa..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/RankedDependency.java
+++ /dev/null
@@ -1,93 +0,0 @@
-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;
-
-public class RankedDependency extends OSGiTestCase {
-    
-    private Element[] deps ;
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.RankedDependency");
-        deps = meta.getElements("requires");
-    }
-    
-    public void testField() {
-        Element dep = getDependencyById(deps, "fs");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-    public void testCallbackBind() {
-        Element dep = getDependencyById(deps, "Bar");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-    public void testCallbackUnbind() {
-        Element dep = getDependencyById(deps, "Baz");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-    public void testBoth() {
-        Element dep = getDependencyById(deps, "inv");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-    public void testBindOnly() {
-        Element dep = getDependencyById(deps, "bindonly");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-    public void testUnbindOnly() {
-        Element dep = getDependencyById(deps, "unbindonly");
-        String opt = dep.getAttribute("comparator");
-        assertEquals("Check comparator", MyComparator.class.getName(), opt);
-    }
-    
-
-    
-    private Element getDependencyById(Element[] deps, String name) {
-        for (int i = 0; i < deps.length; i++) {
-            String na = deps[i].getAttribute("id");
-            String field = deps[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return deps[i];
-            }
-        }
-        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;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
deleted file mode 100644
index edcd7ef..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/ServiceProdiving.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.annotations;
-
-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;
-
-public class ServiceProdiving extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testProvidesSimple() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple");
-        Element[] provs = meta.getElements("provides");
-        assertNotNull("Provides exists ", provs);
-    }
-
-    public void testProvidesDouble() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesDouble");
-        Element[] provs = meta.getElements("provides");
-        assertNotNull("Provides exists ", provs);
-    }
-
-    public void testProvidesTriple() {
-        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];
-        String itfs = prov.getAttribute("specifications");
-        List list = ParseUtils.parseArraysAsList(itfs);
-        assertTrue("Provides CS ", list.contains(CheckService.class.getName()));
-    }
-
-    public void testProvidesQuatro() {
-        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];
-        String itfs = prov.getAttribute("specifications");
-        List list = ParseUtils.parseArraysAsList(itfs);
-        assertTrue("Provides CS ", list.contains(CheckService.class.getName()));
-        assertTrue("Provides Foo ", list.contains(FooService.class.getName()));
-    }
-
-    public void testProperties() {
-        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];
-        Element[] props = prov.getElements("property");
-        assertEquals("Number of properties", props.length, 5);
-        //Foo
-        Element foo = getPropertyByName(props, "foo");
-        assertEquals("Check foo field", "m_foo", foo.getAttribute("field"));
-        assertEquals("Check foo name", "foo", foo.getAttribute("name"));
-        //Bar
-        Element bar = getPropertyByName(props, "bar");
-        assertEquals("Check bar field", "bar", bar.getAttribute("field"));
-        assertEquals("Check bar value", "4", bar.getAttribute("value"));
-        assertEquals("Check mandatory value", "true", bar.getAttribute("mandatory"));
-        //Boo
-        Element boo = getPropertyByName(props, "boo");
-        assertEquals("Check boo field", "boo", boo.getAttribute("field"));
-        //Baa
-        Element baa = getPropertyByName(props, "baa");
-        assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));
-        assertEquals("Check baa name", "baa", baa.getAttribute("name"));
-
-        //Bar
-        Element baz = getPropertyByName(props, "baz");
-        assertEquals("Check baz field", "m_baz", baz.getAttribute("field"));
-        assertEquals("Check baz name", "baz", baz.getAttribute("name"));
-    }
-
-    public void testStaticProperties() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.ProvidesStaticProperties");
-        Element[] provs = meta.getElements("provides");
-        assertNotNull("Provides exists ", provs);
-        Element prov = provs[0];
-        Element[] props = prov.getElements("property");
-        assertEquals("Number of properties", props.length, 9);
-        //Prop1
-        Element foo = getPropertyByName(props, "prop1");
-        assertNull(foo.getAttribute("field"));
-        assertEquals("prop1", foo.getAttribute("value"));
-
-        //Prop2
-        Element prop2 = getPropertyByName(props, "prop2");
-        assertNull(prop2.getAttribute("field"));
-        assertNull(prop2.getAttribute("value"));
-
-        // Props
-        Element prop = getPropertyByName(props, "props");
-        assertNull(prop.getAttribute("field"));
-        assertEquals("{prop1, prop2}", prop.getAttribute("value"));
-
-        // Mandatory
-        Element mandatory = getPropertyByName(props, "mandatory1");
-        assertNull(mandatory.getAttribute("field"));
-        assertNull(mandatory.getAttribute("value"));
-        assertEquals("true", mandatory.getAttribute("mandatory"));
-
-        //Bar
-        Element bar = getPropertyByName(props, "bar");
-        assertEquals("Check bar field", "bar", bar.getAttribute("field"));
-        assertEquals("Check bar value", "4", bar.getAttribute("value"));
-        assertEquals("Check mandatory value", "true", bar.getAttribute("mandatory"));
-        //Boo
-        Element boo = getPropertyByName(props, "boo");
-        assertEquals("Check boo field", "boo", boo.getAttribute("field"));
-        //Baa
-        Element baa = getPropertyByName(props, "baa");
-        assertEquals("Check baa field", "m_baa", baa.getAttribute("field"));
-        assertEquals("Check baa name", "baa", baa.getAttribute("name"));
-
-        //Bar
-        Element baz = getPropertyByName(props, "baz");
-        assertEquals("Check baz field", "m_baz", baz.getAttribute("field"));
-        assertEquals("Check baz name", "baz", baz.getAttribute("name"));
-    }
-
-    public void testServiceController() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PSServiceController");
-        Element[] provs = meta.getElements("provides");
-        assertNotNull("Provides exists ", provs);
-        System.out.println(provs[0].toString());
-        assertNotNull(provs[0].getElements("controller"));
-        assertEquals(1, provs[0].getElements("controller").length);
-        assertEquals("false", provs[0].getElements("controller")[0].getAttribute("value"));
-    }
-
-    public void testServiceControllerWithSpecification() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.PSServiceControllerSpec");
-        Element[] provs = meta.getElements("provides");
-        assertNotNull("Provides exists ", provs);
-        System.out.println(provs[0].toString());
-        assertNotNull(provs[0].getElements("controller"));
-        assertEquals(2, provs[0].getElements("controller").length);
-        assertEquals("false", provs[0].getElements("controller")[0].getAttribute("value"));
-        assertEquals(FooService.class.getName(), provs[0].getElements("controller")[0].getAttribute("specification"));
-    }
-
-    private Element getPropertyByName(Element[] props, String name) {
-        for (int i = 0; i < props.length; i++) {
-            String na = props[i].getAttribute("name");
-            String field = props[i].getAttribute("field");
-            if (na != null && na.equalsIgnoreCase(name)) {
-                return props[i];
-            }
-            if (field != null && field.equalsIgnoreCase(name)) {
-                return props[i];
-            }
-        }
-        fail("Property  " + name + " not found");
-        return null;
-    }
-
-
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
deleted file mode 100644
index 353c910..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/TemporalDependencies.java
+++ /dev/null
@@ -1,168 +0,0 @@
-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;
-
-public class TemporalDependencies extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testSimple() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-        String to = provs[0].getAttribute("timeout");
-        assertNull("No timeout", to);
-        String oto = provs[0].getAttribute("onTimeout");
-        assertNull("No onTimeout", oto);
-    }
-
-    public void testTemporal() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.Temporal");
-        Element[] provs = meta.getElements("temporal", "org.apache.felix.ipojo.handler.temporal");
-        assertNotNull("Temporal exists ", provs);
-        String field = provs[0].getAttribute("field");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-        String to = provs[0].getAttribute("timeout");
-        assertNull("No timeout", to);
-        String oto = provs[0].getAttribute("onTimeout");
-        assertNull("No onTimeout", oto);
-    }
-
-    public void testDI() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String oto = provs[0].getAttribute("onTimeout");
-        assertEquals("onTimeout is the DI", "org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple", oto);
-
-    }
-
-    public void testEmptyArray() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String oto = provs[0].getAttribute("onTimeout");
-        assertEquals("onTimeout is empty-array", "empty-array", oto);
-
-    }
-
-    public void testNull() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String oto = provs[0].getAttribute("onTimeout");
-        assertEquals("onTimeout is null", "null", oto);
-
-    }
-
-    public void testNullable() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String oto = provs[0].getAttribute("onTimeout");
-        assertEquals("onTimeout is nullable", "nullable", oto);
-
-    }
-
-    public void testFilter() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String filter = provs[0].getAttribute("filter");
-        assertEquals("Filter", "(vendor=clement)", filter);
-
-    }
-
-    public void testTimeout() {
-        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");
-        assertNotNull("Field not null", field);
-        assertEquals("Field is fs", "fs", field);
-
-        String to = provs[0].getAttribute("timeout");
-        assertEquals("Check timeout", "100", to);
-
-    }
-
-    public void testSimpleCollection() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
-        Element dep = getElementPerField(meta, "fs1");
-        String spec = dep.getAttribute("specification");
-        assertNotNull("Specification not null", spec);
-        assertEquals("Check specification", "org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", spec);
-    }
-
-    public void testCollectionWithTimeout() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
-        Element dep = getElementPerField(meta, "fs2");
-        String spec = dep.getAttribute("specification");
-        assertNotNull("Specification not null", spec);
-        assertEquals("Check specification", "org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", spec);
-        String to = dep.getAttribute("timeout");
-        assertEquals("Check timeout", "300", to);
-    }
-
-    public void testCollectionWithPolicy() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
-        Element dep = getElementPerField(meta, "fs3");
-        String spec = dep.getAttribute("specification");
-        assertNotNull("Specification not null", spec);
-        assertEquals("Check specification", "org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", spec);
-        String to = dep.getAttribute("ontimeout");
-        assertEquals("Check policy", "empty", to);
-    }
-
-    public void testCollectionWithProxy() {
-        Element meta = helper.getMetadata("org.apache.felix.ipojo.test.scenarios.component.temporal.TemporalCollection");
-        Element dep = getElementPerField(meta, "fs4");
-        String spec = dep.getAttribute("specification");
-        assertNotNull("Specification not null", spec);
-        assertEquals("Check specification", "org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", spec);
-        String proxy = dep.getAttribute("proxy");
-        assertEquals("Check proxy", "true", proxy);
-    }
-
-    private Element getElementPerField(Element elem, String field) {
-        Element[] provs = elem.getElements("requires", "org.apache.felix.ipojo.handler.temporal");
-        assertNotNull("Temporal exists ", provs);
-        for (int i = 0; i < provs.length; i++) {
-            if (provs[i].getAttribute("field").equals(field)) {
-                return provs[i];
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
deleted file mode 100644
index 418364f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/WhiteBoard.java
+++ /dev/null
@@ -1,88 +0,0 @@
-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;
-
-public class WhiteBoard extends OSGiTestCase {
-
-    String typeWI = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWIModification";
-    String typeWO = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoardWOModification";
-    String typeWhiteboards = "org.apache.felix.ipojo.test.scenarios.component.whiteboard.WhiteBoards";
-    String namespace = "org.apache.felix.ipojo.whiteboard";
-
-    private IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-    public void testMetadataWithOnModification() {
-        Element meta = helper.getMetadata(typeWI);
-        assertNotNull("Check meta", meta);
-        Element[] ext = meta.getElements("wbp", namespace);
-        assertEquals("Check size", 1, ext.length);
-        String filter = ext[0].getAttribute("filter");
-        String onArr = ext[0].getAttribute("onArrival");
-        String onDep = ext[0].getAttribute("onDeparture");
-        String onMod = ext[0].getAttribute("onModification");
-
-
-        assertEquals("Check filter", "(foo=true)", filter);
-        assertEquals("Check onArrival", "onArrival", onArr);
-        assertEquals("Check onDeparture", "onDeparture", onDep);
-        assertEquals("Check onModification", "onModification", onMod);
-
-    }
-
-    public void testMetadataWithoutOnModification() {
-        Element meta = helper.getMetadata(typeWO);
-        assertNotNull("Check meta", meta);
-        Element[] ext = meta.getElements("wbp", namespace);
-        assertEquals("Check size", 1, ext.length);
-        String filter = ext[0].getAttribute("filter");
-        String onArr = ext[0].getAttribute("onArrival");
-        String onDep = ext[0].getAttribute("onDeparture");
-        String onMod = ext[0].getAttribute("onModification");
-
-
-        assertEquals("Check filter", "(foo=true)", filter);
-        assertEquals("Check onArrival", "onArrival", onArr);
-        assertEquals("Check onDeparture", "onDeparture", onDep);
-        assertNull("Check onModification", onMod);
-
-    }
-
-    public void testWhiteboards() {
-        Element meta = helper.getMetadata(typeWhiteboards);
-        assertNotNull("Check meta", meta);
-        Element[] ext = meta.getElements("whiteboards", namespace);
-        assertEquals("Check size", 1, ext.length);
-
-        // Two sub-element
-        Element[] wbps = ext[0].getElements("wbp", namespace);
-        assertEquals("Check size", 2, wbps.length);
-
-        String filter = wbps[0].getAttribute("filter");
-        String onArr = wbps[0].getAttribute("onArrival");
-        String onDep = wbps[0].getAttribute("onDeparture");
-        String onMod = wbps[0].getAttribute("onModification");
-
-        assertEquals("Check filter", "(foo=true)", filter);
-        assertEquals("Check onArrival", "onArrival", onArr);
-        assertEquals("Check onDeparture", "onDeparture", onDep);
-        assertNull("Check onModification", onMod);
-
-        filter = wbps[1].getAttribute("filter");
-        onArr = wbps[1].getAttribute("onArrival");
-        onDep = wbps[1].getAttribute("onDeparture");
-        onMod = wbps[1].getAttribute("onModification");
-
-        assertEquals("Check filter", "(foo=true)", filter);
-        assertEquals("Check onArrival", "onArrival", onArr);
-        assertEquals("Check onDeparture", "onDeparture", onDep);
-        assertEquals("Check onModification", "onModification", onMod);
-    }
-
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java
deleted file mode 100644
index ac52244..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java
deleted file mode 100644
index 7eb16a7..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java
deleted file mode 100644
index f35b4f9..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ChildInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-public interface ChildInterface extends ParentInterface1, ParentInterface2 {
-    
-    public void processChild();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java
deleted file mode 100644
index c542725..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java
deleted file mode 100644
index 05680f9..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface1.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-public interface ParentInterface1 extends ParentParentInterface {
-    
-    public void processParent1();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java
deleted file mode 100644
index 7553397..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentInterface2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-public interface ParentInterface2 {
-    
-    public void processParent2();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java
deleted file mode 100644
index 85eff5e..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/annotations/service/ParentParentInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.annotations.service;
-
-public interface ParentParentInterface {
-    
-    public void processParentParent();
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java
deleted file mode 100644
index cfc5ddd..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/AggregateDependency.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Unbind;
-
-@Component
-public class AggregateDependency {
-    
-    @Unbind(aggregate=true)
-    public void unbindBar() {    }
-    @Bind
-    public void bindBar() {    }
-    
-    @Unbind
-    public void unbindBaz() {    }
-    @Bind(aggregate=true)
-    public void bindBaz() {    }
-   
-    @Unbind(aggregate=true, id="unbindonly")
-    public void unbind() {    }
-    
-    @Bind(aggregate=true, id="bindonly")
-    public void bind() {    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java
deleted file mode 100644
index 0ac0e1a..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Arch.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(architecture=true)
-public class Arch {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComponentTypeVersion.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComponentTypeVersion.java
deleted file mode 100644
index a1b08ed..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComponentTypeVersion.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-
-@Component(version="1.0.0")
-public class ComponentTypeVersion {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CustomAnnotationWithEnum.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CustomAnnotationWithEnum.java
deleted file mode 100644
index 5a10c2e..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CustomAnnotationWithEnum.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import foo.RGB;
-import foo.ipojo.IPOJOFoo;
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component
-@IPOJOFoo(bar="bar", rgb = RGB.RED, colors = {RGB.BLUE, RGB.RED})
-public class CustomAnnotationWithEnum {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java
deleted file mode 100644
index b43540a..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DefaultImplementationDependency.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class DefaultImplementationDependency {
-
-    @Requires(defaultimplementation=ProvidesSimple.class, optional=true)
-    public FooService fs;
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
deleted file mode 100644
index 17d8d19..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Dependency.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Modified;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class Dependency {
-
-    @Requires
-    public FooService fs;
-    
-    @Unbind
-    public void unbindBar() {
-        
-    }
-    
-    @Bind
-    public void bindBar() {
-        
-    }
-    
-    @Unbind
-    public void unbindBaz() {
-        
-    }
-    
-    @Bind
-    public void bindBaz() {
-        
-    }
-   
-    
-    @Requires
-    public FooService fs2;
-    
-    @Bind(id="fs2")
-    public void bindFS2() {
-        
-    }
-    
-    @Unbind(id="fs2")
-    public void unbindFS2() {
-        
-    }
-    
-    @Requires(id="inv")
-    public FooService fs2inv;
-    
-    @Bind(id="inv")
-    public void bindFS2Inv() {
-        
-    }
-    
-    @Unbind(id="inv")
-    public void unbindFS2Inv() {
-        
-    }
-    
-    @Bind(id="mod")
-    public void bindMod() {
-        
-    }
-    
-    @Unbind(id="mod")
-    public void unbindMod() {
-        
-    }
-    
-    @Modified(id="mod")
-    public void modifiedMod() {
-        
-    }
-    
-    
-    @Requires(proxy=false, id="notproxied")
-    FooService myFoo;
-    
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java
deleted file mode 100644
index 801f798..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Factory.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(name="factory", publicFactory=true)
-public class Factory {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryDeprecated.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryDeprecated.java
deleted file mode 100644
index bb3e17a..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryDeprecated.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(public_factory=true)
-public class FactoryDeprecated {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethod.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethod.java
deleted file mode 100644
index baa47a5..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethod.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(factoryMethod="create")
-public class FactoryMethod {
-
-    public static FactoryMethod create() {
-        return new FactoryMethod();
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethodDeprecated.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethodDeprecated.java
deleted file mode 100644
index 3f763dd..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FactoryMethodDeprecated.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(factory_method="create")
-public class FactoryMethodDeprecated {
-    
-    public static FactoryMethodDeprecated create() {
-        return new FactoryMethodDeprecated();
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilteredDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilteredDependency.java
deleted file mode 100644
index d064ec3..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FilteredDependency.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class FilteredDependency {
-
-    @Requires(filter="(foo=bar)")
-    public FooService fs;
-    
-    @Unbind(filter="(foo=bar)")
-    public void unbindBar() {    }
-    @Bind
-    public void bindBar() {    }
-    
-    @Unbind
-    public void unbindBaz() {    }
-    @Bind(filter="(foo=bar)")
-    public void bindBaz() {    }
-   
-    @Requires(id="inv")
-    public FooService fs2inv;
-    @Bind(id="inv", filter="(foo=bar)")
-    public void bindFS2Inv() {   }
-    @Unbind(id="inv")
-    public void unbindFS2Inv() {   }
-    
-    @Unbind(filter="(foo=bar)", id="unbindonly")
-    public void unbind() {    }
-    
-    @Bind(filter="(foo=bar)", id="bindonly")
-    public void bind() {    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FromDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FromDependency.java
deleted file mode 100644
index 673830b..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FromDependency.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class FromDependency {
-
-    @Requires(from="X")
-    public FooService fs;
-    
-    @Unbind
-    public void unbindBar() {
-        
-    }
-    
-    @Bind
-    public void bindBar() {
-        
-    }
-    
-    @Unbind(from="both")
-    public void unbindBaz() {
-        
-    }
-    
-    @Bind(from="both")
-    public void bindBaz() {
-        
-    }
-   
-    
-    @Requires
-    public FooService fs2;
-    
-    @Bind(id="fs2", from="X")
-    public void bindFS2() {
-        
-    }
-    
-    @Unbind(id="fs2")
-    public void unbindFS2() {
-        
-    }
-    
-    @Requires(id="inv")
-    public FooService fs2inv;
-    
-    @Bind(id="inv")
-    public void bindFS2Inv() {
-        
-    }
-    
-    @Unbind(id="inv", from="X")
-    public void unbindFS2Inv() {
-        
-    }
-    
-    
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Immediate.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Immediate.java
deleted file mode 100644
index db0f161..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Immediate.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(immediate=true)
-public class Immediate {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateSimple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateSimple.java
deleted file mode 100644
index 57e4b12..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateSimple.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Instantiate;
-
-
-@Instantiate
-@Component
-public class InstantiateSimple {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateWithName.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateWithName.java
deleted file mode 100644
index 76e3e39..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InstantiateWithName.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Instantiate;
-
-
-@Instantiate(name="myInstantiatedInstance")
-@Component
-public class InstantiateWithName {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Lifecycle.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Lifecycle.java
deleted file mode 100644
index dc28af1..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Lifecycle.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Controller;
-import org.apache.felix.ipojo.annotations.Invalidate;
-import org.apache.felix.ipojo.annotations.Validate;
-
-@Component
-public class Lifecycle {
-    @Controller
-    boolean lfc;
-    
-    @Validate
-    public void start() {
-        
-    }
-    
-    @Invalidate
-    public void stop() {
-        
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ManagedServicePID.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ManagedServicePID.java
deleted file mode 100644
index 66bf0c1..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ManagedServicePID.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(managedservice="MyPID")
-public class ManagedServicePID implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MyComparator.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MyComparator.java
deleted file mode 100644
index 085390f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MyComparator.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Comparator;
-
-public class MyComparator implements Comparator {
-
-    public int compare(Object o1, Object o2) {
-        return 0;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java
deleted file mode 100644
index 8e24846..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoAnnotation.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class NoAnnotation {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoArch.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoArch.java
deleted file mode 100644
index 4b5f1a3..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoArch.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(architecture=false)
-public class NoArch {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java
deleted file mode 100644
index d8e15b2..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoFactory.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(name="nofactory", public_factory=false)
-public class NoFactory {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoImmediate.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoImmediate.java
deleted file mode 100644
index 54d1021..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoImmediate.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component(immediate=false)
-public class NoImmediate {
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoPropagation.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoPropagation.java
deleted file mode 100644
index f1003a0..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoPropagation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(propagation=false)
-public class NoPropagation implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableDependency.java
deleted file mode 100644
index 7a5b5de..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableDependency.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class NullableDependency {
-
-    @Requires(nullable=true)
-    public FooService fs;
-    
-    @Requires(nullable=false)
-    public FooService fs2;
-    
-  
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyFoo.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyFoo.java
deleted file mode 100644
index 9431df9..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyFoo.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import foo.Foo;
-
-@Foo(bar="bar")
-public class OnlyFoo {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyiPOJOFoo.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyiPOJOFoo.java
deleted file mode 100644
index 6230887..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OnlyiPOJOFoo.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import foo.ipojo.IPOJOFoo;
-
-@IPOJOFoo(bar="bar")
-public class OnlyiPOJOFoo {
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OptionalDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OptionalDependency.java
deleted file mode 100644
index 3ce2b08..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/OptionalDependency.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class OptionalDependency {
-
-    @Requires(optional=true)
-    public FooService fs;
-    
-    @Requires(optional=false)
-    public FooService fs2;
-    
-    @Unbind(optional=true)
-    public void unbindBar() {    }
-    @Bind
-    public void bindBar() {    }
-    
-    @Unbind
-    public void unbindBaz() {    }
-    @Bind(optional=true)
-    public void bindBaz() {    }
-   
-    @Requires(id="inv")
-    public FooService fs2inv;
-    @Bind(id="inv", optional=true)
-    public void bindFS2Inv() {   }
-    @Unbind(id="inv")
-    public void unbindFS2Inv() {   }
-    
-    @Unbind(optional=true, id="unbindonly")
-    public void unbind() {    }
-    
-    @Bind(optional=true, id="bindonly")
-    public void bind() {    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PIDandPropagation.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PIDandPropagation.java
deleted file mode 100644
index 168439f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PIDandPropagation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(managedservice="MyPID", propagation=true)
-public class PIDandPropagation implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java
deleted file mode 100644
index 13b905c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceController.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.annotations.ServiceController;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {FooService.class, BarService.class})
-public class PSServiceController implements FooService, BarService {
-
-    @ServiceController(value=false)
-    public boolean controller;
-    
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceControllerSpec.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceControllerSpec.java
deleted file mode 100644
index 80e6540..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PSServiceControllerSpec.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.annotations.ServiceController;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {FooService.class, BarService.class})
-public class PSServiceControllerSpec implements FooService, BarService {
-
-    @ServiceController(value=false, specification=FooService.class)
-    public boolean controller1;
-    
-    @ServiceController(value=true)
-    public boolean controller2;
-    
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PolicyDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PolicyDependency.java
deleted file mode 100644
index d4c1213..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PolicyDependency.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class PolicyDependency {
-
-    @Requires(policy="static")
-    public FooService fs;
-    
-    @Requires(policy="dynamic-priority")
-    public FooService fs2;
-    
-    @Unbind(policy="static")
-    public void unbindBar() {    }
-    @Bind
-    public void bindBar() {    }
-    
-    @Unbind
-    public void unbindBaz() {    }
-    @Bind(policy="static")
-    public void bindBaz() {    }
-   
-    @Requires(id="inv")
-    public FooService fs2inv;
-    @Bind(id="inv", policy="static")
-    public void bindFS2Inv() {   }
-    @Unbind(id="inv")
-    public void unbindFS2Inv() {   }
-    
-    @Unbind(policy="static", id="unbindonly")
-    public void unbind() {    }
-    
-    @Bind(policy="static", id="bindonly")
-    public void bind() {    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Propagation.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Propagation.java
deleted file mode 100644
index 51caaf6..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Propagation.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(propagation=true)
-public class Propagation implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropagationandPID.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropagationandPID.java
deleted file mode 100644
index 7c6287f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropagationandPID.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(managedservice="MyPID", propagation=true)
-public class PropagationandPID implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java
deleted file mode 100644
index 0737138..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Properties.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class Properties implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5", mandatory=true)
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesDouble.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesDouble.java
deleted file mode 100644
index 56c06e9..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesDouble.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides
-public class ProvidesDouble implements FooService {
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java
deleted file mode 100644
index a1de405..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesProperties.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.annotations.ServiceProperty;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {FooService.class, BarService.class})
-public class ProvidesProperties implements FooService, BarService {
-    
-    @ServiceProperty(name = "foo")
-    public int m_foo = 0;
-    
-    @ServiceProperty(value = "4", mandatory=true)
-    public int bar;
-    
-    @ServiceProperty(name="baz")
-    int m_baz;
-    
-    @ServiceProperty
-    public int boo;
-    
-    @ServiceProperty(name="baa", value="5")
-    public int m_baa;
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesQuatro.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesQuatro.java
deleted file mode 100644
index 49d2f02..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesQuatro.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {FooService.class, CheckService.class})
-public class ProvidesQuatro implements FooService, BarService, CheckService {
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-    public boolean check() {
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesSimple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesSimple.java
deleted file mode 100644
index 56e877c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesSimple.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {FooService.class, BarService.class})
-public class ProvidesSimple implements FooService, BarService {
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesStaticProperties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesStaticProperties.java
deleted file mode 100644
index c9e02f2..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesStaticProperties.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.annotations.ServiceProperty;
-import org.apache.felix.ipojo.annotations.StaticServiceProperty;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(
-		specifications= {FooService.class, BarService.class},
-		properties= {
-				@StaticServiceProperty(name="prop1", value="prop1", type="java.lang.String"),
-				@StaticServiceProperty(name="prop2", type="java.lang.String"),
-				@StaticServiceProperty(name="props", value="{prop1, prop2}", type="string[]"),
-				@StaticServiceProperty(name="mandatory1", mandatory=true, type="string")
-		})
-public class ProvidesStaticProperties implements FooService, BarService {
-
-    @ServiceProperty(name = "foo")
-    public int m_foo = 0;
-
-    @ServiceProperty(value = "4", mandatory=true)
-    public int bar;
-
-    @ServiceProperty(name="baz")
-    int m_baz;
-
-    @ServiceProperty
-    public int boo;
-
-    @ServiceProperty(name="baa", value="5")
-    public int m_baa;
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesTriple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesTriple.java
deleted file mode 100644
index c6fbe89..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ProvidesTriple.java
+++ /dev/null
@@ -1,55 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-@Provides(specifications= {CheckService.class})
-public class ProvidesTriple implements FooService, BarService, CheckService {
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public Properties getProps() {
-        return null;
-    }
-
-    public boolean check() {
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedDependency.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedDependency.java
deleted file mode 100644
index 5d84262..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedDependency.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.annotations.Bind;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Unbind;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class RankedDependency {
-
-    @Requires(comparator = MyComparator.class)
-    public FooService fs;
-
-    @Unbind(comparator = MyComparator.class)
-    public void unbindBar() {
-    }
-
-    @Bind
-    public void bindBar() {
-    }
-
-    @Unbind
-    public void unbindBaz() {
-    }
-
-    @Bind(comparator = MyComparator.class)
-    public void bindBaz() {
-    }
-
-    @Requires(id = "inv")
-    public FooService fs2inv;
-
-    @Bind(id = "inv", comparator = MyComparator.class)
-    public void bindFS2Inv() {
-    }
-
-    @Unbind(id = "inv")
-    public void unbindFS2Inv() {
-    }
-
-    @Unbind(comparator = MyComparator.class, id = "unbindonly")
-    public void unbind() {
-    }
-
-    @Bind(comparator = MyComparator.class, id = "bindonly")
-    public void bind() {
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithManagedService.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithManagedService.java
deleted file mode 100644
index 108f772..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithManagedService.java
+++ /dev/null
@@ -1,82 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.annotations.Updated;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component(managedservice="MyPID")
-public class UpdatedWithManagedService implements FooService, BarService {
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5")
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-    
-    @Updated
-    public void after(Dictionary conf) {
-        // ...
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithProperties.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithProperties.java
deleted file mode 100644
index 7d56c44..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/UpdatedWithProperties.java
+++ /dev/null
@@ -1,83 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Property;
-import org.apache.felix.ipojo.annotations.Updated;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-
-@Component
-public class UpdatedWithProperties implements FooService, BarService {
-    
-    @Updated
-    public void after(Dictionary dict) {
-        // ...
-    }
-    
-    @Property(name="foo")
-    public int m_foo = 0;
-    
-    @Property(value = "4")
-    public int bar;
-    
-    @Property
-    public void setboo(int boo) {
-        
-    }
-    
-    @Property
-    public void setbaz(int baz) {
-        
-    }
-    
-    @Property
-    public int boo;
-    
-    @Property(name="baa")
-    public int m_baa;
-    
-    @Property(value="5", mandatory=true)
-    public void setbaa(int baa) {
-        
-    }
-
-    public boolean foo() {
-        return false;
-    }
-
-    public java.util.Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean bar() {
-        return false;
-    }
-
-    public java.util.Properties getProps() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/error/AbstractClass.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/error/AbstractClass.java
deleted file mode 100644
index 4cc792c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/error/AbstractClass.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.error;
-
-import org.apache.felix.ipojo.annotations.Requires;
-
-public abstract class AbstractClass {
-
-	@Requires
-	private Runnable run;
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
deleted file mode 100644
index ac75616..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSub.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.event;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.event.Subscriber;
-import org.osgi.service.event.Event;
-
-
-@Component
-public class PubSub {
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p1", synchronous=true)
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher1;
-
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p2", synchronous=false, topics="foo,bar", dataKey="data")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher2;
-
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p3", synchronous=true, topics="bar")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher3;
-
-    @Subscriber(name="s1", dataKey="data")
-    public void receive1(Object foo) {
-        // Nothing
-    }
-
-    @Subscriber(name="s2", topics="foo,bar", filter="(foo=true)")
-    public void receive2(Event foo) {
-        // Nothing
-    }
-
-
-    @Subscriber(name="s3", topics="foo", dataKey="data", dataType="java.lang.String")
-    public void receive3(String foo) {
-        // Nothing
-    }
-
-
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubDeprecated.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubDeprecated.java
deleted file mode 100644
index 618f6ff..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubDeprecated.java
+++ /dev/null
@@ -1,37 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.event;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.event.Subscriber;
-import org.osgi.service.event.Event;
-
-
-@Component
-public class PubSubDeprecated {
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p1", synchronous=true)
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher1;
-    
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p2", synchronous=false, topics="foo,bar", data_key="data")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher2;
-    
-    @org.apache.felix.ipojo.handlers.event.Publisher(name="p3", synchronous=true, topics="bar")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher3;
-    
-    @Subscriber(name="s1", data_key="data")
-    public void receive1(Object foo) {
-        // Nothing
-    }
-    
-    @Subscriber(name="s2", topics="foo,bar", filter="(foo=true)")
-    public void receive2(Event foo) {
-        // Nothing
-    }
-    
-    
-    @Subscriber(name="s3", topics="foo", data_key="data", data_type="java.lang.String")
-    public void receive3(String foo) {
-        // Nothing
-    }
-    
-    
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubWithPublishes.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubWithPublishes.java
deleted file mode 100644
index a40eb7e..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/event/PubSubWithPublishes.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.event;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.event.Publishes;
-import org.apache.felix.ipojo.handlers.event.Subscriber;
-import org.osgi.service.event.Event;
-
-
-@Component
-public class PubSubWithPublishes {
-    @Publishes(name="p1", synchronous=true)
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher1;
-
-    @Publishes(name="p2", synchronous=false, topics="foo,bar", dataKey="data")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher2;
-
-    @Publishes(name="p3", synchronous=true, topics="bar")
-    org.apache.felix.ipojo.handlers.event.publisher.Publisher publisher3;
-
-    @Subscriber(name="s1", dataKey="data")
-    public void receive1(Object foo) {
-        // Nothing
-    }
-
-    @Subscriber(name="s2", topics="foo,bar", filter="(foo=true)")
-    public void receive2(Event foo) {
-        // Nothing
-    }
-
-
-    @Subscriber(name="s3", topics="foo", dataKey="data", dataType="java.lang.String")
-    public void receive3(String foo) {
-        // Nothing
-    }
-
-
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
deleted file mode 100644
index 230388a..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/extender/Extender.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.extender;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.osgi.framework.Bundle;
-
-
-@Component
-@org.apache.felix.ipojo.extender.Extender(extension="foo", onArrival="onArrival", onDeparture="onDeparture")
-public class Extender {
-    
-    public void onArrival(Bundle bundle, String foo) {
-        // nothing
-    }
-    
-    public void onDeparture(Bundle bundle) {
-        // nothing
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXDeprecated.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXDeprecated.java
deleted file mode 100644
index ab374b0..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXDeprecated.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.jmx;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.jmx.Config;
-import org.apache.felix.ipojo.handlers.jmx.Method;
-import org.apache.felix.ipojo.handlers.jmx.Property;
-
-@Component
-@Config(domain="my-domain", usesMOSGi=false)
-public class JMXDeprecated {
-
-    @Property(name="prop", notification=true, rights="w")
-    String m_foo;
-    
-    @Method(description="set the foo prop")
-    public void setFoo(String mes) {
-        System.out.println("Set foo to " + mes);
-        m_foo = mes;
-    }
-    
-    @Method(description="get the foo prop")
-    public String getFoo() {
-        return m_foo;
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
deleted file mode 100644
index 675dc40..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/jmx/JMXSimple.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.jmx;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.jmx.Config;
-import org.apache.felix.ipojo.handlers.jmx.JMXMethod;
-import org.apache.felix.ipojo.handlers.jmx.JMXProperty;
-
-@Component
-@Config(domain="my-domain", usesMOSGi=false)
-public class JMXSimple {
-
-    @JMXProperty(name="prop", notification=true, rights="w")
-    String m_foo;
-
-    @JMXMethod(description="set the foo prop")
-    public void setFoo(String mes) {
-        System.out.println("Set foo to " + mes);
-        m_foo = mes;
-    }
-
-    @JMXMethod(description="get the foo prop")
-    public String getFoo() {
-        return m_foo;
-    }
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java
deleted file mode 100644
index c2b9d5c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/Temporal.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class Temporal {
-
-    @org.apache.felix.ipojo.handler.temporal.Temporal
-    private FooService fs;
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalCollection.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalCollection.java
deleted file mode 100644
index 3a1143c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalCollection.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import java.util.Collection;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-
-@Component
-public class TemporalCollection {
-    
-    @Requires(specification="org.apache.felix.ipojo.test.scenarios.annotations.service.FooService")
-    private Collection fs1;
-    
-    @Requires(specification="org.apache.felix.ipojo.test.scenarios.annotations.service.FooService", timeout=300)
-    private Collection fs2;
-    
-    @Requires(onTimeout="empty", specification="org.apache.felix.ipojo.test.scenarios.annotations.service.FooService")
-    private Collection fs3;
-    
-    @Requires(proxy=true, specification="org.apache.felix.ipojo.test.scenarios.annotations.service.FooService")
-    private Collection fs4;
-    
-    
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalSimple.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalSimple.java
deleted file mode 100644
index a235c0b..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalSimple.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalSimple {
-    
-    @Requires
-    private FooService fs;
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithDI.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithDI.java
deleted file mode 100644
index e4c44a9..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithDI.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithDI {
-    
-    @Requires(onTimeout="org.apache.felix.ipojo.test.scenarios.component.ProvidesSimple")
-    private FooService fs;
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithEmptyArray.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithEmptyArray.java
deleted file mode 100644
index 695b69c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithEmptyArray.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithEmptyArray {
-    
-    @Requires(onTimeout="empty-array")
-    private FooService fs[];
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithFilter.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithFilter.java
deleted file mode 100644
index f73bb7c..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithFilter.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithFilter {
-    
-    @Requires(filter="(vendor=clement)")
-    private FooService fs;
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNull.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNull.java
deleted file mode 100644
index 2baf722..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNull.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithNull {
-    
-    @Requires(onTimeout="null")
-    private FooService fs;
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNullable.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNullable.java
deleted file mode 100644
index eb4a595..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithNullable.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithNullable {
-    
-    @Requires(onTimeout="nullable")
-    private FooService fs;
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithTimeout.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithTimeout.java
deleted file mode 100644
index 06d71b4..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/temporal/TemporalWithTimeout.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.temporal;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handler.temporal.Requires;
-import org.apache.felix.ipojo.test.scenarios.annotations.service.FooService;
-
-@Component
-public class TemporalWithTimeout {
-    
-    @Requires(timeout=100)
-    private FooService fs;
-    
-    
-    
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
deleted file mode 100644
index 840d899..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWIModification.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.whiteboard;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.osgi.framework.ServiceReference;
-
-@Component
-@org.apache.felix.ipojo.whiteboard.Wbp(filter="(foo=true)", 
-        onArrival="onArrival", 
-        onDeparture="onDeparture",
-        onModification="onModification")
-public class WhiteBoardWIModification {
-    
-    public void onArrival(ServiceReference ref) {
-        // nothing
-    }
-    
-    public void onDeparture(ServiceReference ref) {
-        // nothing
-    }
-    
-    public void onModification(ServiceReference ref) {
-        // nothing
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
deleted file mode 100644
index 1424db1..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoardWOModification.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.whiteboard;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.osgi.framework.ServiceReference;
-
-@Component
-@org.apache.felix.ipojo.whiteboard.Wbp(filter="(foo=true)", onArrival="onArrival", onDeparture="onDeparture")
-public class WhiteBoardWOModification {
-    
-    public void onArrival(ServiceReference ref) {
-        // nothing
-    }
-    
-    public void onDeparture(ServiceReference ref) {
-        // nothing
-    }
-
-}
diff --git a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoards.java b/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoards.java
deleted file mode 100644
index 540837f..0000000
--- a/ipojo/tests/core/annotations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/whiteboard/WhiteBoards.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.whiteboard;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.whiteboard.Whiteboards;
-import org.apache.felix.ipojo.whiteboard.Wbp;
-import org.osgi.framework.ServiceReference;
-
-@Component
-@Whiteboards(whiteboards={
-		@Wbp(filter="(foo=true)", onArrival="onArrival", onDeparture="onDeparture"),
-		@Wbp(filter="(foo=true)", onArrival="onArrival", onDeparture="onDeparture", onModification="onModification")
-	})
-public class WhiteBoards {
-
-    public void onArrival(ServiceReference ref) {
-        // nothing
-    }
-
-    public void onDeparture(ServiceReference ref) {
-        // nothing
-    }
-
-    public void onModification(ServiceReference ref) {
-        // nothing
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/pom.xml b/ipojo/tests/core/bad-configurations/pom.xml
deleted file mode 100644
index 0f0e9a4..0000000
--- a/ipojo/tests/core/bad-configurations/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Bad Configurations Test Suite</name>
-  <artifactId>tests.core.bad.configurations</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.bad.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.bad.BadTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
deleted file mode 100644
index 58cd15d..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadFactories.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-
-public class BadFactories extends OSGiTestCase {
-    
-    private Element getElementFactoryWithNoClassName() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("name", "noclassname"));
-        return elem;        
-    }
-    
-    private Element getElementHandlerFactoryWithNoClassName() {
-        Element elem = new Element("handler", "");
-        elem.addAttribute(new Attribute("name", "noclassname"));
-        return elem;        
-    }
-   
-    private Element getElementHandlerFactoryWithNoName() {
-        Element elem = new Element("handler", "");
-        elem.addAttribute(new Attribute("className", "noclassname"));
-        return elem;        
-    }
-    
-    public void testBadFactory() {
-        try {
-            new ComponentFactory(getContext(), getElementFactoryWithNoClassName());
-            fail("A factory with no class name must be rejected");
-        } catch (ConfigurationException e) {
-          // OK.   
-        }
-    }
-    
-    public void testBadHandlerFactory1() {
-        try {
-            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoClassName());
-            fail("An handler factory with no class name must be rejected");
-        } catch (ConfigurationException e) {
-          // OK.   
-        }
-    }
-    
-    public void testBadHandlerFactory2() {
-        try {
-            new HandlerManagerFactory(getContext(), getElementHandlerFactoryWithNoName());
-            fail("An handler factory with no name must be rejected");
-        } catch (ConfigurationException e) {
-          // OK.   
-        }
-    }
-    
-    public void testCreationOnBadConstructor() {
-            Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadConstructor");
-            ComponentInstance ci;
-            try {
-                // Change in Felix-966, now throws a runtime exception
-                ci = factory.createComponentInstance(null);
-                //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
-                ci.dispose();
-                fail("Exception expected");
-            } catch (Throwable e) {
-               //fail("Exception unexpected : " + e.getMessage());
-               // OK
-            }
-    }
-    
-    public void testCreationOnBadFactory() {
-        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory");
-        ComponentInstance ci;
-        try {
-            // Change in Felix-966, now throw a runtime exception
-            ci = factory.createComponentInstance(null);
-            //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
-            ci.dispose();
-            fail("Exception expected");
-        } catch (Throwable e) {
-           //fail("Exception unexpected : " + e.getMessage());
-            //OK
-        }
-    }
-    
-    public void testCreationOnBadFactory2() {
-        Factory factory = Utils.getFactoryByName(getContext(), "BAD-BadFactory2");
-        ComponentInstance ci;
-        try {
-            // Change in Felix-966, now throw a runtime exception
-            ci = factory.createComponentInstance(null);
-            //assertEquals("Check ci create error", ComponentInstance.STOPPED, ci.getState());
-            ci.dispose();
-            fail("Exception expected");
-        } catch (Throwable e) {
-           //fail("Exception unexpected : " + e.getMessage());
-            //Ok
-        }
-    }
-    
-    public void testNoManipulationMetadata() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"));
-        try {
-            ComponentFactory fact = new ComponentFactory(getContext(), elem);
-            fact.stop();
-            fail("A factory with no manipulation metadata must be rejected");
-        } catch (ConfigurationException e) {
-          // OK.
-        }
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
deleted file mode 100644
index 2749e30..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCCallback.java
+++ /dev/null
@@ -1,254 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-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.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-
-public class BadLFCCallback extends OSGiTestCase {
-    
-    private String clazz = "org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService";
-    private String type = "BAD-CallbackCheckService";
-    private Element manipulation;
-    private Properties props;
-    
-    public void setUp() {
-        manipulation = getManipulationForComponent();
-        props = new Properties();
-        props.put("instance.name","BAD");
-    }
-    
-    
-    private Element getNothing() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getNoTransition() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        callback.addAttribute(new Attribute("method", "start"));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getNoMethod() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        callback.addAttribute(new Attribute("transition", "validate"));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadMethod() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        callback.addAttribute(new Attribute("transition", "validate"));
-        callback.addAttribute(new Attribute("method", "start_")); // Missing method.
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadMethod2() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        callback.addAttribute(new Attribute("transition", "invalidate"));
-        callback.addAttribute(new Attribute("method", "stop_")); // Missing method.
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadTransition() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("callback", "");
-        callback.addAttribute(new Attribute("method", "start"));
-        callback.addAttribute(new Attribute("transition", "validate_"));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getManipulationForComponent() {
-        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
-        Element elem = null;
-        try {
-            elem = ManifestMetadataParser.parseHeaderMetadata(header);
-        } catch (ParseException e) {
-            fail("Parse Exception when parsing iPOJO-Component");
-        }
-        
-        assertNotNull("Check elem not null", elem);
-        
-        Element manip = getManipulationForComponent(elem, type);
-        assertNotNull("Check manipulation metadata not null for " + type, manip);
-        return manip;
-    }
-    
-    private Element getManipulationForComponent(Element metadata, String comp_name) {
-        Element[] comps = metadata.getElements("component");
-        for(int i = 0; i < comps.length; i++) {
-            if(comps[i].containsAttribute("factory") && comps[i].getAttribute("factory").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-            if(comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-        }
-        return null;
-    }
-    
-    public void testNothing() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A lifecycle callback with a missing method and transition must be rejected " + cf);
-        } catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testNoTransition() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNoTransition());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A lifecycle callback with a missing transition must be rejected " + cf);
-        } catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testNoMethod() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNoMethod());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A lifecycle callback with a missing method must be rejected " + cf);
-        }catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadMethod() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            if (ci.isStarted()) {
-                fail("A lifecycle callback with a bad method must be rejected (instance stills valid)" + cf);
-            }
-            ci.dispose();
-            cf.stop();
-        } catch (ConfigurationException e) {
-            //The check does not happen in the configure method.
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadMethod2() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadMethod2());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.stop();
-            if (ci.isStarted()) {
-                fail("A lifecycle callback with a bad method must be rejected (instance stills valid)" + cf);
-            }
-            ci.dispose();
-            cf.stop();
-        } catch (ConfigurationException e) {
-            //The check does not happen in the configure method.
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadTransition() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadTransition());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A lifecycle callback with a bad transition must be rejected " + cf);
-        } catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
deleted file mode 100644
index 3089aa3..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadLFCController.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-
-public class BadLFCController extends OSGiTestCase {
-    
-    private String clazz = "org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest";
-    
-    private Element getNoFieldController() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element controller = new Element("controller", "");
-        elem.addElement(controller);
-        return elem;
-    }
-    
-    private Element getBadFieldController() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element controller = new Element("controller", "");
-        controller.addAttribute(new Attribute("field", "controller")); // Missing field
-        elem.addElement(controller);
-        elem.addElement(getManipulationForComponent("BAD-lcTest"));
-        return elem;
-    }
-    
-    private Element getManipulationForComponent(String comp_name) {
-        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
-        Element elem = null;
-        try {
-            elem = ManifestMetadataParser.parseHeaderMetadata(header);
-        } catch (ParseException e) {
-            fail("Parse Exception when parsing iPOJO-Component");
-        }
-        
-        assertNotNull("Check elem not null", elem);
-        
-        Element manip = getManipulationForComponent(elem, comp_name);
-        assertNotNull("Check manipulation metadata not null for " + comp_name, manip);
-        return manip;
-    }
-    
-    private Element getManipulationForComponent(Element metadata, String comp_name) {
-        Element[] comps = metadata.getElements("component");
-        for(int i = 0; i < comps.length; i++) {
-            if(comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-        }
-        return null;
-    }
-    
-    public void testNoField() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNoFieldController());
-            cf.start();
-            cf.stop();
-            fail("A lifecycle controller with a missing field must be rejected " + cf);
-        } catch (Exception e) {
-            // OK
-        }
-    }
-    
-    public void testBadField() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadFieldController());
-            cf.start();
-            cf.stop();
-            fail("A lifecycle controller with a bad field must be rejected " + cf);
-        } catch (Exception e) {
-            // OK
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
deleted file mode 100644
index 63bcc87..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadServiceDependencies.java
+++ /dev/null
@@ -1,260 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-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.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.test.scenarios.bad.service.BarService;
-
-public class BadServiceDependencies extends OSGiTestCase {
-    
-    private String clazz = "org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider";
-    private String type = "BAD-BothCheckServiceProvider";
-    private Element manipulation;
-    private Properties props;
-    
-    public void setUp() {
-        manipulation = getManipulationForComponent();
-        props = new Properties();
-        props.put("instance.name","BAD");
-    }
-    
-    
-    private Element getNothing() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getNoField() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("filter", "(foo=bar)"));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadField() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("field", "BAD_FIELD")); // missing field.
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadFilter() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("field", "fs"));
-        callback.addAttribute(new Attribute("filter", "(foo=bar)&(bar=foo)")); // Incorrect filter
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadFrom() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("field", "fs"));
-        callback.addAttribute(new Attribute("from", "ba(d&_")); // Incorrect from
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadType() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("field", "fs"));
-        callback.addAttribute(new Attribute("interface", BarService.class.getName()));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    private Element getBadAggregate() {
-        Element elem = new Element("component", "");
-        elem.addAttribute(new Attribute("classname", clazz));
-        
-        Element callback = new Element("requires", "");
-        callback.addAttribute(new Attribute("field", "fs"));
-        callback.addAttribute(new Attribute("aggregate", "true"));
-        elem.addElement(callback);
-        elem.addElement(manipulation);
-        return elem;
-    }
-    
-    
-    private Element getManipulationForComponent() {
-        String header = (String) getContext().getBundle().getHeaders().get("iPOJO-Components");
-        Element elem = null;
-        try {
-            elem = ManifestMetadataParser.parse(header);
-        } catch (ParseException e) {
-            fail("Parse Exception when parsing iPOJO-Component");
-        }
-        
-        assertNotNull("Check elem not null", elem);
-        
-        Element manip = getManipulationForComponent(elem, type);
-        assertNotNull("Check manipulation metadata not null for " + type, manip);
-        return manip;
-    }
-    
-    private Element getManipulationForComponent(Element metadata, String comp_name) {
-        Element[] comps = metadata.getElements("component");
-        for(int i = 0; i < comps.length; i++) {
-            if(comps[i].containsAttribute("factory") && comps[i].getAttribute("factory").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-            if(comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-        }
-        return null;
-    }
-    
-    public void testNothing() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNothing());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with neither field and method must be rejected " + cf);
-        } catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testNoField() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getNoField());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with neither field and method must be rejected " + cf);
-        } catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadField() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadField());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with a bad field must be rejected " + cf);
-        }catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadFilter() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadFilter());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with a bad filter must be rejected " + cf);
-        }catch (ConfigurationException e) {
-            //OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadFrom() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadFrom());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with a bad from must be rejected " + cf);
-        }catch (ConfigurationException e) {
-            //OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-    
-    public void testBadType() {
-        try {
-            ComponentFactory cf = new ComponentFactory(getContext(), getBadType());
-            cf.start();
-            ComponentInstance ci = cf.createComponentInstance(props);
-            ci.dispose();
-            cf.stop();
-            fail("A service requirement with a bad type must be rejected " + cf);
-        }catch (ConfigurationException e) {
-           // OK
-        } catch (UnacceptableConfiguration e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        } catch (MissingHandlerException e) {
-            fail("Unexpected exception when creating an instance : " + e.getMessage());
-        }
-    }
-  }
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java
deleted file mode 100644
index 71d7db0..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/BadTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class BadTestSuite {
-    
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Bad configuration test suite", bc);
-        ots.addTestSuite(BadFactories.class);
-        ots.addTestSuite(BadLFCController.class);
-        ots.addTestSuite(BadLFCCallback.class);
-        ots.addTestSuite(BadServiceDependencies.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java
deleted file mode 100644
index e3d8b8b..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java
deleted file mode 100644
index f9e7e2d..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java
deleted file mode 100644
index cdebe3f..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/bad/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.bad.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java
deleted file mode 100644
index 74c6159..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/BadConstructors.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class BadConstructors {
-    
-    public BadConstructors() {
-        throw new Error("BAD");
-    }
-    
-    public BadConstructors(int i) {
-        // DO NOTHING
-    }
-    
-    public static BadConstructors createBad() {
-        throw new RuntimeException("BAD");
-    }
-    
-    public static BadConstructors createBad2(int o) {
-        return new BadConstructors(o);
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
deleted file mode 100644
index 86b9679..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
-
-public class CallbackCheckService extends ParentClass implements CheckService {
-
-    int i = 0;
-
-    FooService fs;
-
-    public static CallbackCheckService singleton;
-
-    public static int count = 0;
-
-    private static CallbackCheckService singleton() {
-        if (singleton == null) {
-            count++;
-            singleton = new CallbackCheckService();
-        }
-        return singleton;
-    }
-
-    public static CallbackCheckService several() {
-        count++;
-        return new CallbackCheckService();
-    }
-
-    private void start() {
-        i++;
-    }
-
-    protected void stop() {
-        i++;
-    }
-
-    public boolean check() {
-        return fs.foo();
-    }
-
-    public Properties getProps() {
-        Properties p = new Properties();
-        p.put("int", new Integer(i));
-        p.put("count", new Integer(count));
-        return p;
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
deleted file mode 100644
index 05d9f31..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index 71b5e77..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.bad.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
deleted file mode 100644
index 8cef49f..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.bad.service.CheckService;
-
-public class LifecycleControllerTest implements CheckService {
-    
-    private boolean m_state = true;
-    private String m_conf;
-    
-    public void setConf(String newConf) {
-        if (newConf.equals("foo")) {
-            m_state = true;
-        } else {
-            m_state = false;
-        }
-    }
-
-    public boolean check() {
-        return m_state;
-    }
-
-    public Properties getProps() {
-       Properties props = new Properties();
-       props.put("conf", m_conf);
-       props.put("state", new Boolean(m_state));
-       return props;
-    }
-}
-
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
deleted file mode 100644
index f7fb580..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass {
-    
-    public void parentStart() {
-        
-    }
-    
-    public void parentStop() {
-        
-    }
-	
-	protected String[] strings;
-	
-	protected String string;
-	
-	protected int upStrings;
-	
-	protected int upString;
-	
-	public void updateStrings(String[] bb) {
-        strings = bb;
-        upStrings++;
-    }
-    
-    public void updateString(String bb) {
-        string = bb;
-        upString++;
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 5d33264..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-//import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/bad-configurations/src/main/resources/metadata.xml b/ipojo/tests/core/bad-configurations/src/main/resources/metadata.xml
deleted file mode 100644
index 9dca0d9..0000000
--- a/ipojo/tests/core/bad-configurations/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,52 +0,0 @@
-<ipojo>
-	<!-- No XSD as this file violates the format -->
-	<component
-		className="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-		name="BAD-CallbackCheckService" architecture="true">
-		<requires field="fs" />
-		<provides />
-		<callback transition="validate" method="start" />
-		<callback transition="invalidate" method="stop" />
-	</component>
-	
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
-		name="BAD-lcTest">
-		<provides />
-		<controller field="m_state" />
-		<properties>
-			<property name="conf" field="m_conf" method="setConf" />
-		</properties>
-	</component>
-	
-	<component
-		className="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-		name="BAD-BothCheckServiceProvider" architecture="true">
-		<requires field="fs">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-	
-	<!-- Bad constructors -->
-	<component 
-		className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
-		name="BAD-BadConstructor"
-		immediate="true"
-	/>
-	
-	<component
-		className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
-		factory-method="createBad"
-		name="BAD-BadFactory"
-		immediate="true"
-	/>
-	
-	<component
-		className="org.apache.felix.ipojo.test.scenarios.component.BadConstructors"
-		factory-method="createBad2"
-		name="BAD-BadFactory2"
-		immediate="true"
-	/>
-</ipojo>
diff --git a/ipojo/tests/core/configadmin/pom.xml b/ipojo/tests/core/configadmin/pom.xml
deleted file mode 100644
index c484331..0000000
--- a/ipojo/tests/core/configadmin/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Configuration Admin Management Test Suite</name>
-  <artifactId>tests.core.configadmin</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.configadmin.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.configadmin.ConfigurationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java
deleted file mode 100644
index 693ff1b..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableFooProvider.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
-
-public class ConfigurableFooProvider implements FooService {
-    
-    private String message; // Configurable property
-    private int invokeCount = 0;
-    
-    public void setMessage(String message) {
-        System.err.println("=== Set message to " + message);
-        this.message = message;
-        invokeCount++;
-    }
-
-    public boolean foo() {
-        return true;
-    }
-
-    public Properties fooProps() {
-        Properties props = new Properties();
-        if (message == null) {
-            props.put("message", "NULL");
-        } else {
-            props.put("message", message);
-        }
-        props.put("count", new Integer(invokeCount));
-        return props;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return invokeCount;
-    }
-
-    public int getInt() {
-        return invokeCount;
-    }
-
-    public long getLong() {
-        return invokeCount;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationMonitor.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationMonitor.java
deleted file mode 100644
index 403e61a..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationMonitor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import junit.framework.Assert;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.cm.ConfigurationEvent;
-import org.osgi.service.cm.ConfigurationListener;
-
-public class ConfigurationMonitor implements ConfigurationListener {
-    
-    private String waitForEvent;
-    private boolean detected;
-    private ServiceRegistration reg;
-
-    public synchronized void configurationEvent(ConfigurationEvent arg0) {
-        System.out.println(arg0.getPid() + " reconfiguration received");
-        if (waitForEvent != null) {
-            if (arg0.getPid().equals(waitForEvent)) {
-                detected = true;
-            }
-        }
-    }
-    
-    public ConfigurationMonitor(BundleContext bc) {
-        reg = bc.registerService(ConfigurationListener.class.getName(), this, null);
-    }
-    
-    public void stop() {
-        reg.unregister();
-        reg = null;
-    }
-    
-    public void waitForEvent(String pid, String mes) {
-        waitForEvent = pid;
-        detected = false;
-        long begin = System.currentTimeMillis();
-        long duration = 0;
-        while( ! detected) {
-            try {
-                Thread.sleep(500);
-            } catch (InterruptedException e) {
-                // Interrupted
-            }
-            long end = System.currentTimeMillis();
-            duration = end - begin;
-            if (duration > 10000) {
-                Assert.fail(mes + " -> Timeout when waiting for a reconfiguration of " + pid);
-            }
-        }
-        System.out.println("Reconfiguration detected of " + pid);
-        waitForEvent = null;
-        detected = false;
-    }
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationTestSuite.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationTestSuite.java
deleted file mode 100644
index 5e01b33..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ConfigurationTestSuite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ConfigurationTestSuite {
-    
-    public static long UPDATE_WAIT_TIME = 2000;
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Configuration Admin Test Suite", bc);
-		  ots.addTestSuite(ManagedServiceFactoryTestForServices.class);
-	      ots.addTestSuite(ManagedServiceFactoryTestForImmediate.class);
-	      ots.addTestSuite(ManagedServiceTestForImmediate.class);
-	      ots.addTestSuite(ManagedServiceTestForService.class);
-		return ots;
-	}
-	
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
deleted file mode 100644
index 01f9590..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForImmediate.java
+++ /dev/null
@@ -1,378 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-
-public class ManagedServiceFactoryTestForImmediate extends OSGiTestCase {
-    
-    private ComponentFactory factory;
-    private ConfigurationAdmin admin;
-    
-    public void setUp() {
-        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)");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-    
-    public void tearDown() {
-        try {
-            Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ImmConfigurableProvider)");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        admin = null;
-
-        
-    }
-    
-    public void testCreationAndReconfiguration() {
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ImmConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        //  The instance should be created, wait for the architecture service
-        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, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testCreationAndReconfiguration2() {
-        //The reconfiguration happens before the service invocation
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ImmConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        System.out.println("PID : " + pid);
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        //  The instance should be created, wait for the architecture service
-        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, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check object -2", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        //Invoke
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-                
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testDelayedCreationAndReconfiguration() {
-        factory.stop();
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ImmConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        
-        factory.start();
-
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        
-        //  The instance should be created, wait for the architecture service
-        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, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        //assertEquals("Assert count", 2, count);
-        // This test was removed as the result can be 3. 
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testDelayedCreationAndReconfiguration2() {
-        factory.stop();
-        //The reconfiguration happens before the service invocation
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ImmConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        assertNull("check no instance", Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        
-        factory.start();
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        
-        //  The instance should be created, wait for the architecture service
-        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, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check object -1", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        //Invoke
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-                
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
deleted file mode 100644
index 3429f96..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceFactoryTestForServices.java
+++ /dev/null
@@ -1,382 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-
-public class ManagedServiceFactoryTestForServices extends OSGiTestCase {
-    
-    private ComponentFactory factory;
-    private ConfigurationAdmin admin;
-    
-    public void setUp() {
-        factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "CA-ConfigurableProvider");
-        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
-        assertNotNull("Check configuration admin availability", admin);
-        try {
-            Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ConfigurableProvider)");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-    
-    public void tearDown() {
-        try {
-            Configuration[] configurations = admin.listConfigurations("(service.factoryPid=CA-ConfigurableProvider)");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-        admin = null;
-
-        
-    }
-    
-    public void testCreationAndReconfiguration() {
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        System.out.println("PID : " + pid);
-        
-        //  The instance should be created, wait for the architecture service
-        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);        
-        
-        Utils.waitForService(getContext(), FooService.class.getName(), "(instance.name="+pid+")");       
-        
-        ServiceReference refx = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNotNull("Check refx", refx);
-        FooService fs = (FooService) Utils.getServiceObject(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNotNull("Check fs", fs);
-        
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        
-        Dictionary p2 = configuration.getProperties();
-        p2.put("message", "message2");
-        try {
-            System.err.println("The configuration will be updated with message2");
-
-            configuration.update(p2);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        System.err.println("The configuration should be updated with message2");
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testCreationAndReconfiguration2() {
-        //The reconfiguration happens before the service invocation
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        
-        //  The instance should be created, wait for the architecture service
-        Utils.waitForService(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-       // architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object -2", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        //Invoke
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-                
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testDelayedCreationAndReconfiguration() {
-        factory.stop();
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        Utils.waitForService(getContext(), 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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-     // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        System.out.println("===");
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        System.out.println("===");
-        
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 2, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    public void testDelayedCreationAndReconfiguration2() {
-        factory.stop();
-        //The reconfiguration happens before the service invocation
-        Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("CA-ConfigurableProvider", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-        props.put("message", "message");
-        
-        try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-        String pid = configuration.getPid();
-        System.out.println("PID : " + 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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        Architecture architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-     // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-        
-        props.put("message", "message2");
-        try {
-            configuration.update(props);
-            // Update the configuration ...
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        //architecture = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Check no object -2", 0, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-        
-        //Invoke
-        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(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-        
-        assertEquals("Assert Message", "message2", mes);
-        assertEquals("Assert count", 1, count);
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) architecture.getInstanceDescription()).getCreatedObjects().length);
-                
-        try {
-            configuration.delete();
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReference(getContext(), FooService.class.getName(), "(instance.name=" + pid + ")");
-        assertNull("Check unavailability", ref);
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
deleted file mode 100644
index 67e944f..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForImmediate.java
+++ /dev/null
@@ -1,365 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-
-public class ManagedServiceTestForImmediate extends OSGiTestCase {
-    
-    private String factNameImm = "CA-ImmConfigurableProvider";
-    private String msp = "foo";
-
-    private ComponentFactory factImm;
-    
-    private ConfigurationAdmin admin;
-    
-    ConfigurationMonitor listener;
-    
-    
-    public void setUp() {
-        factImm = (ComponentFactory) Utils.getFactoryByName(getContext(), factNameImm);
-        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
-        assertNotNull("Check configuration admin availability", admin);
-        cleanConfigurationAdmin();
-        listener = new ConfigurationMonitor(getContext());
-    }
-    
-    public void tearDown() {
-        listener.stop();
-        cleanConfigurationAdmin();
-        admin = null;
-    }
-    
-    private void cleanConfigurationAdmin() {
-        try {
-            Configuration[] configurations = admin.listConfigurations("(service.pid=" + msp + ")");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-    
-    public void testFactoryCreationAndReconfiguration() {
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factImm.createComponentInstance(props);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message", mes);
-        assertEquals("Check count", 1, count);
-        
-        //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            //Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-            listener.waitForEvent(configuration.getPid(), "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message2", mes);
-        assertEquals("Check count", 2, count);
-        
-        instance.dispose();
-        
-    }
-    
-    public void testMSFCreationAndReconfiguration() {
-        Configuration conf = null;
-        try {
-            conf = admin.createFactoryConfiguration(factNameImm);
-            Dictionary props = conf.getProperties();
-            if (props == null) {
-                props = new Properties();
-            }
-            props.put("managed.service.pid", msp);
-            props.put("message", "message");
-            conf.update(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME); // Wait for the creation.
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        
-        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-       // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message", mes);
-        assertEquals("Check count", 1, count);
-        
-        //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            //Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-            listener.waitForEvent(configuration.getPid(), "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-      //  arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-
-       // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        if (mes.equals("message")) {
-            System.out.println("Warning, configuration not yet applied");
-            assertEquals("Check count - W", 1, count);
-        } else {
-            assertEquals("Check message", "message2", mes);
-            assertEquals("Check count", 2, count);
-        }
-        
-        try {
-            conf.delete();
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-    }
-    
-    public void testCreationAndReconfiguration2() {
-        // The configuration exists before the instance creation.
-        
-      //Update
-        Configuration configuration = null;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factImm.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-      //  int count1 = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message - 1 (" + mes +")", "message2", mes); // Already reconfigured.
-       // assertEquals("Check count", 2, count); // Two : 1) "message" on immediate, "message2" on the reconfiguration, 
-                                                // not necessary as the property can be set before the immediate instance creation
-        
-        instance.dispose();
-        
-        //Reconfiguration
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message3");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        // Recreation of the instance.
-        props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        instance  = null;
-        try {
-            instance =  factImm.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME * 2);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-       // int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message already reconfigured", "message3", mes); // Already reconfigured.
-        //assertEquals("Check count", count1 + 1, count); // message before the reconfiguration, message3 after the reconfiguration
-        
-        instance.dispose();
-        
-        
-    }
-
-    public void testCreationAndReconfiguration3() {
-        // The configuration exists before the instance creation.
-        
-      //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factImm.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-      // int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message2", mes); // Already reconfigured.
-        //assertEquals("Check count", 1, count);
-        
-        //Reconfiguration
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message3");
-            configuration.update(prc);
-            //Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-            listener.waitForEvent(msp, "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        instance.dispose();
-        
-        // Recreation of the instance.
-        props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        instance  = null;
-        try {
-            instance =  factImm.createComponentInstance(props);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-      //  count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message3", mes); // Already reconfigured.
-       // assertEquals("Check count", 1, count);
-        
-        instance.dispose();
-        
-        
-    }
-   
-    
-    
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
deleted file mode 100644
index 42e0202..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/ManagedServiceTestForService.java
+++ /dev/null
@@ -1,368 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configadmin;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configadmin.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-
-public class ManagedServiceTestForService extends OSGiTestCase {
-    
-    private String factNameSvc = "CA-ConfigurableProvider";
-    private String msp = "foo";
-
-    private ComponentFactory factSvc;
-    
-    private ConfigurationAdmin admin;
-    
-    ConfigurationMonitor listener;
-    
-    
-    public void setUp() {
-        factSvc = (ComponentFactory) Utils.getFactoryByName(getContext(), factNameSvc);
-        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
-        assertNotNull("Check configuration admin availability", admin);
-        cleanConfigurationAdmin();
-        listener = new ConfigurationMonitor(getContext());
-    }
-    
-    public void tearDown() {
-        listener.stop();
-        cleanConfigurationAdmin();
-        admin = null;
-    }
-    
-    private void cleanConfigurationAdmin() {
-        try {
-            Configuration[] configurations = admin.listConfigurations("(service.pid=" + msp + ")");
-            for (int i = 0; configurations != null && i < configurations.length; i++) {
-                configurations[i].delete();
-            }
-        } catch (IOException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        } catch (InvalidSyntaxException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
-        }
-    }
-    
-    public void testFactoryCreationAndReconfiguration() {
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factSvc.createComponentInstance(props);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message", mes);
-        assertEquals("Check count", 1, count);
-        
-        //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        if (mes.equals("message")) {
-            System.out.println("Warning, configuration not yet applied");
-            assertEquals("Check count - W", 1, count);
-        } else {
-            assertEquals("Check message", "message2", mes);
-            assertEquals("Check count", 2, count);
-        }
-        
-        instance.dispose();
-        
-    }
-    
-    public void testMSFCreationAndReconfiguration() {
-        Configuration conf = null;
-        try {
-            conf = admin.createFactoryConfiguration(factNameSvc);
-            Dictionary props = conf.getProperties();
-            if (props == null) {
-                props = new Properties();
-            }
-            props.put("managed.service.pid", msp);
-            props.put("message", "message");
-            conf.update(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME); // Wait for the creation.
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        
-        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message", mes);
-        assertEquals("Check count", 1, count);
-        
-        //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), conf.getPid());
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-
-        // arch = (Architecture) Utils.getServiceObject(getContext(), org.apache.felix.ipojo.architecture.Architecture.class.getName(), "(architecture.instance=" + conf.getPid() + ")");
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) arch.getInstanceDescription()).getCreatedObjects().length);
-        if (mes.equals("message")) {
-            System.out.println("Warning, configuration not yet applied");
-            assertEquals("Check count - W", 1, count);
-        } else {
-            assertEquals("Check message", "message2", mes);
-            assertEquals("Check count", 2, count);
-        }
-        
-        try {
-            conf.delete();
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        
-    }
-    
-    public void testCreationAndReconfiguration2() {
-        // The configuration exists before the instance creation.
-        
-      //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factSvc.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message2", mes); // Already reconfigured.
-        assertEquals("Check count", 1, count);
-        
-        instance.dispose();
-        
-        //Reconfiguration
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message3");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "2");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        // Recreation of the instance.
-        props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        instance  = null;
-        try {
-            instance =  factSvc.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message3", mes); // Already reconfigured.
-        assertEquals("Check count", 1, count);
-        
-        instance.dispose();
-        
-        
-    }
-
-    public void testCreationAndReconfiguration3() {
-        // The configuration exists before the instance creation.
-        
-      //Update
-        Configuration configuration;
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message2");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "1");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        Properties props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        ComponentInstance instance  = null;
-        try {
-            instance =  factSvc.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        FooService fs = (FooService) getContext().getService(ref);
-        Properties p = fs.fooProps();
-        String mes = p.getProperty("message");
-        int count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message2", mes); // Already reconfigured.
-        assertEquals("Check count", 1, count);
-        
-        //Reconfiguration
-        try {
-            configuration = admin.getConfiguration(msp);
-            Dictionary prc = configuration.getProperties();
-            if (prc == null) {
-                prc = new Properties();
-            }
-            prc.put("message", "message3");
-            configuration.update(prc);
-            listener.waitForEvent(msp, "2");
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-        
-        instance.dispose();
-        
-        // Recreation of the instance.
-        props = new Properties();
-        props.put("managed.service.pid", msp);
-        props.put("message", "message");
-        instance  = null;
-        try {
-            instance =  factSvc.createComponentInstance(props);
-            Thread.sleep(ConfigurationTestSuite.UPDATE_WAIT_TIME);
-        } catch (Exception e) {
-           fail(e.getMessage());
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-        assertEquals("Check no object", 0, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertNotNull("FS availability", ref);
-        
-        fs = (FooService) getContext().getService(ref);
-        p = fs.fooProps();
-        mes = p.getProperty("message");
-        count = ((Integer) p.get("count")).intValue();
-        assertEquals("Check 1 object", 1, ((PrimitiveInstanceDescription) instance.getInstanceDescription()).getCreatedObjects().length);
-        assertEquals("Check message", "message3", mes); // Already reconfigured.
-        assertEquals("Check count", 1, count);
-        
-        instance.dispose();
-        
-        
-    }
-   
-    
-    
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/CheckService.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/CheckService.java
deleted file mode 100644
index 6b9cfa0..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configadmin.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/FooService.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/FooService.java
deleted file mode 100644
index 94abc61..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/configadmin/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configadmin.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index c45c079..0000000
--- a/ipojo/tests/core/configadmin/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,346 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static void waitForService(BundleContext context, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(context, itf, filter);
-        int count = 0;
-        if (refs.length != 0) {
-            return;
-        } else {
-            while(refs.length == 0) {
-                try {
-                    Thread.sleep(5);
-                } catch (InterruptedException e) {
-                    // Interrupted
-                }
-                count++;
-                if (count == 100) {
-                    throw new RuntimeException("Timeout ... no services match with " + filter);
-                }
-                refs = getServiceReferences(context, itf, filter);
-            }
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/configadmin/src/main/resources/metadata.xml b/ipojo/tests/core/configadmin/src/main/resources/metadata.xml
deleted file mode 100644
index 09134da..0000000
--- a/ipojo/tests/core/configadmin/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,21 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd" xmlns="org.apache.felix.ipojo">
-		<component classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableFooProvider" 
-			name="CA-ConfigurableProvider">
-			<provides></provides>
-			<properties>
-				<property name="message" method="setMessage"/>
-			</properties>
-		</component>
-		<component classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableFooProvider" 
-			immediate="true"
-			name="CA-ImmConfigurableProvider">
-			<provides></provides>
-			<properties>
-				<property name="message" method="setMessage"/>
-			</properties>
-		</component>
-		
-		
-			
-</ipojo>
diff --git a/ipojo/tests/core/configuration/pom.xml b/ipojo/tests/core/configuration/pom.xml
deleted file mode 100644
index c7c1c22..0000000
--- a/ipojo/tests/core/configuration/pom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Configuration Management Test Suite</name>
-  <artifactId>tests.core.configuration</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-	  <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-    <groupId>org.osgi</groupId>
-    <artifactId>org.osgi.compendium</artifactId>
-    <version>4.0.0</version>
-  </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.configuration.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.configuration.ConfigurationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-      <!-- Test -->
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin
-        </artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/configuration/src/main/ipojo/metadata.xml b/ipojo/tests/core/configuration/src/main/ipojo/metadata.xml
deleted file mode 100644
index 05e233c..0000000
--- a/ipojo/tests/core/configuration/src/main/ipojo/metadata.xml
+++ /dev/null
@@ -1,250 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-		<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="CONFIG-FooProviderType-Conf" architecture="true">
-		<provides />
-		<properties propagation="false">
-			<property name="int" field="intProp" value="2" />
-			<property name="boolean" field="boolProp" value="false" />
-			<property name="string" field="strProp" value="foo" />
-			<property name="strAProp" field="strAProp"
-				value="{foo, bar}" />
-			<property name="intAProp" field="intAProp" value="{1,2, 3}" />
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="CONFIG-FooProviderType-ConfNoValue" architecture="true">
-		<provides />
-		<properties propagation="false">
-			<property name="int" field="intProp"/>
-			<property name="boolean" field="boolProp"/>
-			<property name="string" field="strProp"/>
-			<property name="strAProp" field="strAProp"/>
-			<property name="intAProp" field="intAProp"/>
-		</properties>
-	</component>
-
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="CONFIG-FooProviderType-3" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-	<!-- Configuration Management Test -->
-	<component name="CONFIG-FieldConfigurableCheckService"
-		classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
-		architecture="true">
-		<provides />
-		<properties propagation="true">
-			<property field="b" />
-			<property field="s" />
-			<property field="i" />
-			<property field="l" />
-			<property field="d" />
-			<property field="f" />
-			<property field="c" />
-			<property field="bool" />
-			<property field="bs" />
-			<property field="ss" />
-			<property field="is" />
-			<property field="ls" />
-			<property field="ds" />
-			<property field="fs" />
-			<property field="cs" />
-			<property field="bools" />
-			<property field="string" />
-			<property field="strings" />
-		</properties>
-	</component>
-
-	<component name="CONFIG-BothConfigurableCheckService"
-		classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
-		architecture="true">
-		<provides />
-		<properties propagation="true">
-			<property field="b" method="updateB" />
-			<property field="s" method="updateS" />
-			<property field="i" method="updateI" />
-			<property field="l" method="updateL" />
-			<property field="d" method="updateD" />
-			<property field="f" method="updateF" />
-			<property field="c" method="updateC" />
-			<property field="bool" method="updateBool" />
-			<property field="bs" method="updateBs" />
-			<property field="ss" method="updateSs" />
-			<property field="is" method="updateIs" />
-			<property field="ls" method="updateLs" />
-			<property field="ds" method="updateDs" />
-			<property field="fs" method="updateFs" />
-			<property field="cs" method="updateCs" />
-			<property field="bools" method="updateBools" />
-			<property field="string" method="updateString" />
-			<property field="strings" method="updateStrings" />
-		</properties>
-	</component>
-
-	<component name="CONFIG-MethodConfigurableCheckService"
-		classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableCheckServiceProvider"
-		architecture="true">
-		<provides />
-		<properties propagation="true">
-			<property method="updateB" name="b" />
-			<property method="updateS" name="s" />
-			<property method="updateI" name="i" />
-			<property method="updateL" name="l" />
-			<property method="updateD" name="d" />
-			<property method="updateF" name="f" />
-			<property method="updateC" name="c" />
-			<property method="updateBool" name="bool" />
-			<property method="updateBs" name="bs" />
-			<property method="updateSs" name="ss" />
-			<property method="updateIs" name="is" />
-			<property method="updateLs" name="ls" />
-			<property method="updateDs" name="ds" />
-			<property method="updateFs" name="fs" />
-			<property method="updateCs" name="cs" />
-			<property method="updateBools" name="bools" />
-			<property method="updateString" name="string" />
-			<property method="updateStrings" name="strings" />
-		</properties>
-	</component>
-
-	<component name="CONFIG-ParentMethodConfigurableCheckService"
-		classname="org.apache.felix.ipojo.test.scenarios.component.ParentConfigurableCheckServiceProvider"
-		architecture="true">
-		<provides />
-		<properties propagation="true">
-			<property method="updateB" name="b" />
-			<property method="updateS" name="s" />
-			<property method="updateI" name="i" />
-			<property method="updateL" name="l" />
-			<property method="updateD" name="d" />
-			<property method="updateF" name="f" />
-			<property method="updateC" name="c" />
-			<property method="updateBool" name="bool" />
-			<property method="updateBs" name="bs" />
-			<property method="updateSs" name="ss" />
-			<property method="updateIs" name="is" />
-			<property method="updateLs" name="ls" />
-			<property method="updateDs" name="ds" />
-			<property method="updateFs" name="fs" />
-			<property method="updateCs" name="cs" />
-			<property method="updateBools" name="bools" />
-			<property method="updateString" name="string" type="string" />
-			<property method="updateStrings" name="strings"
-				type="java.lang.String[]" />
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="CONFIG-FooProviderType-4" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true" pid="FooProvider-3">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.ComplexConfiguration">
-		<provides>
-			<property name="array" field="m_array"/>
-			<property name="complex-array" field="m_complexArray"/>
-			<property name="list" field="m_list"/>
-			<property name="complex-list" field="m_complexList"/>
-			<property name="map" field="m_map"/>
-			<property name="complex-map" field="m_complexMap"/>
-			<property name="dict" field="m_dict"/>
-			<property name="empty-array" type="String[]"/>
-			<property name="empty-map" type="java.util.HashMap"/>
-			<property name="empty-list" type="java.util.List"/>
-		</provides>
-		<properties>
-			<property name="array" field="m_array"/>
-			<property name="complex-array" field="m_complexArray"/>
-			<property name="list" field="m_list"/>
-			<property name="complex-list" field="m_complexList"/>
-			<property name="map" field="m_map"/>
-			<property name="complex-map" field="m_complexMap"/>
-			<property name="dict" field="m_dict"/>
-		</properties>
-	</component>
-
-	<instance component="org.apache.felix.ipojo.test.scenarios.component.ComplexConfiguration" name="complex">
-		<property name="array" type="array">
-			<property value="a"/>
-			<property value="b"/>
-		</property>
-		<property name="list" type="list">
-			<property value="a"/>
-			<property value="b"/>
-		</property>
-		<property name="dict" type="dictionary">
-			<property name="a" value="a"/>
-			<property name="b" value="b"/>
-		</property>
-		<property name="map" type="map">
-			<property name="a" value="a"/>
-			<property name="b" value="b"/>
-		</property>
-		<property name="complex-array" type="array">
-			<property type="list">
-				<property value="a"/>
-				<property value="b"/>
-			</property>
-			<property type="list">
-				<property value="c"/>
-				<property value="d"/>
-			</property>
-		</property>
-		<property name="complex-list" type="list">
-			<property type="list">
-				<property value="a"/>
-				<property value="b"/>
-			</property>
-			<property type="list">
-				<property value="c"/>
-				<property value="d"/>
-			</property>
-		</property>
-		<property name="complex-map" type="map">
-			<property name="a" type="list">
-				<property value="a"/>
-				<property value="b"/>
-			</property>
-			<property name="b" type="list">
-				<property value="c"/>
-				<property value="d"/>
-			</property>
-		</property>
-		<property name="empty-array" type="array"/>
-		<property name="empty-list" type="list"/>
-		<property name="empty-map" type="map"/>
-	</instance>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.PropertyModifier">
-		<provides>
-			<property field="classes"/>
-		</provides>
-		<properties>
-			<property method="setClasses" name="cls"/>
-		</properties>
-	</component>
-</ipojo>
diff --git a/ipojo/tests/core/configuration/src/main/ipojo/updated.xml b/ipojo/tests/core/configuration/src/main/ipojo/updated.xml
deleted file mode 100644
index 45fd9b7..0000000
--- a/ipojo/tests/core/configuration/src/main/ipojo/updated.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<!--  updated -->
-	 <component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="CONFIG-FooProviderType-ConfUpdated" architecture="true">
-		<provides />
-		<properties updated="updated">
-			<property name="int" field="intProp" value="2" />
-			<property name="boolean" field="boolProp" value="false" />
-			<property name="string" field="strProp" value="foo" />
-			<property name="strAProp" field="strAProp"
-				value="{foo, bar}" />
-			<property name="intAProp" field="intAProp" value="{1,2, 3}" />
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="CONFIG-FooProviderType-ConfNoValueUpdated" architecture="true">
-		<provides />
-		<properties updated="updated">
-			<property name="int" field="intProp"/>
-			<property name="boolean" field="boolProp"/>
-			<property name="string" field="strProp"/>
-			<property name="strAProp" field="strAProp"/>
-			<property name="intAProp" field="intAProp"/>
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="CONFIG-FooProviderType-4Updated" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true" pid="FooProvider-3" updated="updated">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
-		name="CONFIG-FooProviderType-4Updated2" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true" pid="FooProvider-3" updated="updated">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="CONFIG-FooProviderType-3Updated" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true" updated="updated">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
-		name="CONFIG-FooProviderType-3Updated2" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-			<property name="baz" type="java.lang.String" />
-		</provides>
-		<properties propagation="true" updated="updated">
-			<property name="foo" field="m_foo" />
-			<property name="bar" field="m_bar" />
-		</properties>
-	</component>
-
-</ipojo>
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
deleted file mode 100644
index 11bf266..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index 5b2494e..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComplexConfiguration.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComplexConfiguration.java
deleted file mode 100644
index f460048..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ComplexConfiguration.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-
-public class ComplexConfiguration implements CheckService {
-    
-    private List m_list;
-    private Map m_map;
-    private Dictionary m_dict;
-    private String[] m_array;
-    
-    private List m_complexList;
-    private Map m_complexMap;
-    private Object[] m_complexArray;
-
-    public boolean check() {
-        return true;
-    }
-    
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("list", m_list);
-        props.put("map", m_map);
-        props.put("dict", m_dict);
-        props.put("array", m_array);
-        props.put("complex-list", m_complexList);
-        props.put("complex-map", m_complexMap);
-        props.put("complex-array", m_complexArray);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
deleted file mode 100644
index bf9d3c7..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableCheckServiceProvider.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-
-public class ConfigurableCheckServiceProvider implements CheckService {
-    
-    // Integer types
-    byte b;
-    short s;
-    int i;
-    long l;
-    
-    // Floatting types
-    double d;
-    float f;
-    
-    // Character
-    char c;
-    
-    // Boolean
-    boolean bool;
-    
-    // Integer arrays 
-    byte[] bs;
-    short[] ss;
-    int[] is;
-    long[] ls;
-    
-    double[] ds;
-    float[] fs;
-    
-    char[] cs;
-    
-    boolean[] bools;
-    
-    String string;
-    String[] strings;
-    
-    int upB, upS, upI, upL, upD, upF, upC, upBool, upBs, upSs, upIs, upLs, upDs, upFs, upCs, upBools, upString, upStrings;
-    
-
-    public boolean check() {
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("b", new Byte(b));
-        props.put("s", new Short(s));
-        props.put("i", new Integer(i));
-        props.put("l", new Long(l));
-        props.put("d", new Double(d));
-        props.put("f", new Float(f));
-        props.put("c", new Character(c));
-        props.put("bool", new Boolean(bool));
-        
-        if (bs != null) {
-            props.put("bs", bs);
-        }
-        if (ss != null) {
-            props.put("ss", ss);
-        }
-        if (is != null) {
-            props.put("is", is);
-        }
-        if (ls != null) {
-            props.put("ls", ls);
-        }
-        if (ds != null) {
-            props.put("ds", ds);
-        }
-        if (fs != null) {
-            props.put("fs", fs);
-        }
-        if (cs != null) {
-            props.put("cs", cs);
-        }
-        if (bools != null) {
-            props.put("bools", bools);
-        }
-        
-        props.put("upb", new Integer(upB));
-        props.put("ups", new Integer(upS));
-        props.put("upi", new Integer(upI));
-        props.put("upl", new Integer(upL));
-        props.put("upd", new Integer(upD));
-        props.put("upf", new Integer(upF));
-        props.put("upc", new Integer(upC));
-        props.put("upbool", new Integer(upBool));
-        
-        props.put("upbs", new Integer(upBs));
-        props.put("upss", new Integer(upSs));
-        props.put("upis", new Integer(upIs));
-        props.put("upls", new Integer(upLs));
-        props.put("upds", new Integer(upDs));
-        props.put("upfs", new Integer(upFs));
-        props.put("upcs", new Integer(upCs));
-        props.put("upbools", new Integer(upBools));
-        
-        if (string != null) {
-            props.put("string", string);
-        }
-        if (string != null) {
-            props.put("strings", strings);
-        }
-       
-        props.put("upstring", new Integer(upString));
-        props.put("upstrings", new Integer(upStrings));
-        
-        return props;
-    }
-    
-    public void updateB(byte bb) {
-        b = bb;
-        upB++;
-    }
-    
-    public void updateS(short bb) {
-        s = bb;
-        upS++;
-    }
-    
-    public void updateI(int bb) {
-        i = bb;
-        upI++;
-    }
-    
-    public void updateL(long bb) {
-        l = bb;
-        upL++;
-    }
-    
-    public void updateD(double bb) {
-        d = bb;
-        upD++;
-    }
-    
-    public void updateF(float bb) {
-        f = bb;
-        upF++;
-    }
-    
-    public void updateC(char bb) {
-        c = bb;
-        upC++;
-    }
-    
-    public void updateBool(boolean bb) {
-        bool = bb;
-        upBool++;
-    }
-    
-    public void updateBs(byte[] bb) {
-        bs = bb;
-        upBs++;
-    }
-    
-    public void updateSs(short[] bb) {
-        ss = bb;
-        upSs++;
-    }
-    
-    public void updateIs(int[] bb) {
-        is = bb;
-        upIs++;
-    }
-    
-    public void updateLs(long[] bb) {
-        ls = bb;
-        upLs++;
-    }
-    
-    public void updateDs(double[] bb) {
-        ds = bb;
-        upDs++;
-    }
-    
-    public void updateFs(float[] bb) {
-        fs = bb;
-        upFs++;
-    }
-    
-    public void updateCs(char[] bb) {
-        cs = bb;
-        upCs++;
-    }
-    
-    public void updateBools(boolean[] bb) {
-        bools = bb;
-        upBools++;
-    }
-    
-    public void updateStrings(String[] bb) {
-        strings = bb;
-        upStrings++;
-    }
-    
-    public void updateString(String bb) {
-        string = bb;
-        upString++;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 03ccbfc..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-
-	private int m_bar;
-	private String m_foo;
-
-    private BundleContext m_context;
-
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-
-    private int updated;
-    private Dictionary lastupdated;
-
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-            m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-
-        p.put("count", new Integer(count));
-
-        p.put("updated", new Integer(updated));
-        if (lastupdated != null) {
-            p.put("lastupdated", lastupdated);
-        }
-
-
-		return p;
-	}
-
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-
-        }
-    }
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-	public void updated(Dictionary props) {
-        updated++;
-        lastupdated = props;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
deleted file mode 100644
index 62db9c2..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType2 implements FooService {
-
-	private int m_bar;
-	private String m_foo;
-
-    private BundleContext m_context;
-
-    private static int count = 0;
-
-    private int updated;
-
-
-    public FooProviderType2(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-            m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-
-        p.put("count", new Integer(count));
-
-        p.put("updated", new Integer(updated));
-
-
-		return p;
-	}
-
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-
-        }
-    }
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType2(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-	public void updated() {
-        updated++;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
deleted file mode 100644
index 9ec08de..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-
-public class FooProviderTypeDyn implements FooService {
-	
-	private int intProp;	
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-    private int updated;
-    private Dictionary lastUpdate;
-
-	public boolean foo() {
-		intProp = 3;
-		boolProp = true;
-		if(strProp == null || strProp.equals("foo")) { strProp = "bar"; }
-		else { strProp = "foo"; }
-		strAProp = new String[] {"foo", "bar", "baz"};
-		intAProp = new int[] {3, 2, 1};
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		if (strProp != null) {
-		      p.put("strProp", strProp);
-		}
-		if (strAProp != null) {
-		    p.put("strAProp", strAProp);
-		}
-		if (intAProp != null) {
-		    p.put("intAProp", intAProp);
-		}
-		
-		p.put("updated", new Integer(updated));
-		if (lastUpdate != null) {
-		    p.put("lastupdated", lastUpdate);
-		}
-		
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	public void updated(Dictionary props) {
-	    updated++;
-	    lastUpdate = props;
-	}
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
deleted file mode 100644
index f7fb580..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass {
-    
-    public void parentStart() {
-        
-    }
-    
-    public void parentStop() {
-        
-    }
-	
-	protected String[] strings;
-	
-	protected String string;
-	
-	protected int upStrings;
-	
-	protected int upString;
-	
-	public void updateStrings(String[] bb) {
-        strings = bb;
-        upStrings++;
-    }
-    
-    public void updateString(String bb) {
-        string = bb;
-        upString++;
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
deleted file mode 100644
index 1dc7212..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentConfigurableCheckServiceProvider.java
+++ /dev/null
@@ -1,194 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-
-public class ParentConfigurableCheckServiceProvider extends ParentClass implements CheckService {
-    
-    // Integer types
-    byte b;
-    short s;
-    int i;
-    long l;
-    
-    // Floatting types
-    double d;
-    float f;
-    
-    // Character
-    char c;
-    
-    // Boolean
-    boolean bool;
-    
-    // Integer arrays 
-    byte[] bs;
-    short[] ss;
-    int[] is;
-    long[] ls;
-    
-    double[] ds;
-    float[] fs;
-    
-    char[] cs;
-    
-    boolean[] bools;
-    
-    //String string;
-    //String[] strings;
-    
-    int upB, upS, upI, upL, upD, upF, upC, upBool, upBs, upSs, upIs, upLs, upDs, upFs, upCs, upBools/*, upString, upStrings*/;
-    
-
-    public boolean check() {
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("b", new Byte(b));
-        props.put("s", new Short(s));
-        props.put("i", new Integer(i));
-        props.put("l", new Long(l));
-        props.put("d", new Double(d));
-        props.put("f", new Float(f));
-        props.put("c", new Character(c));
-        props.put("bool", new Boolean(bool));
-        
-        props.put("bs", bs);
-        props.put("ss", ss);
-        props.put("is", is);
-        props.put("ls", ls);
-        props.put("ds", ds);
-        props.put("fs", fs);
-        props.put("cs", cs);
-        props.put("bools", bools);
-        
-        props.put("upb", new Integer(upB));
-        props.put("ups", new Integer(upS));
-        props.put("upi", new Integer(upI));
-        props.put("upl", new Integer(upL));
-        props.put("upd", new Integer(upD));
-        props.put("upf", new Integer(upF));
-        props.put("upc", new Integer(upC));
-        props.put("upbool", new Integer(upBool));
-        
-        props.put("upbs", new Integer(upBs));
-        props.put("upss", new Integer(upSs));
-        props.put("upis", new Integer(upIs));
-        props.put("upls", new Integer(upLs));
-        props.put("upds", new Integer(upDs));
-        props.put("upfs", new Integer(upFs));
-        props.put("upcs", new Integer(upCs));
-        props.put("upbools", new Integer(upBools));
-        
-        props.put("string", string);
-        props.put("strings", strings);
-        props.put("upstring", new Integer(upString));
-        props.put("upstrings", new Integer(upStrings));
-        
-        return props;
-    }
-    
-    public void updateB(byte bb) {
-        b = bb;
-        upB++;
-    }
-    
-    public void updateS(short bb) {
-        s = bb;
-        upS++;
-    }
-    
-    public void updateI(int bb) {
-        i = bb;
-        upI++;
-    }
-    
-    public void updateL(long bb) {
-        l = bb;
-        upL++;
-    }
-    
-    public void updateD(double bb) {
-        d = bb;
-        upD++;
-    }
-    
-    public void updateF(float bb) {
-        f = bb;
-        upF++;
-    }
-    
-    public void updateC(char bb) {
-        c = bb;
-        upC++;
-    }
-    
-    public void updateBool(boolean bb) {
-        bool = bb;
-        upBool++;
-    }
-    
-    public void updateBs(byte[] bb) {
-        bs = bb;
-        upBs++;
-    }
-    
-    public void updateSs(short[] bb) {
-        ss = bb;
-        upSs++;
-    }
-    
-    public void updateIs(int[] bb) {
-        is = bb;
-        upIs++;
-    }
-    
-    public void updateLs(long[] bb) {
-        ls = bb;
-        upLs++;
-    }
-    
-    public void updateDs(double[] bb) {
-        ds = bb;
-        upDs++;
-    }
-    
-    public void updateFs(float[] bb) {
-        fs = bb;
-        upFs++;
-    }
-    
-    public void updateCs(char[] bb) {
-        cs = bb;
-        upCs++;
-    }
-    
-    public void updateBools(boolean[] bb) {
-        bools = bb;
-        upBools++;
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java
deleted file mode 100644
index a127ddd..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PropertyModifier.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.osgi.framework.BundleContext;
-
-public class PropertyModifier implements CheckService {
-    
-    private Class[] classes;
-    private BundleContext context;
-    
-    PropertyModifier(BundleContext bc) {
-        context = bc;
-    }
-
-    public boolean check() {
-        return classes != null;
-    }
-    
-    public void setClasses(String[] classes) throws ClassNotFoundException {
-        Class[] cls = new Class[classes.length];
-        for (int i = 0; i < classes.length; i++) {
-            try {
-                cls[i] = context.getBundle().loadClass(classes[i]);
-            } catch (ClassNotFoundException e) {
-                e.printStackTrace();
-                throw e;
-            }
-        }
-        
-        this.classes = cls;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("classes", classes);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ArchitectureTest.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ArchitectureTest.java
deleted file mode 100644
index a41448c..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ArchitectureTest.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.handlers.configuration.ConfigurationHandlerDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-
-public class ArchitectureTest extends OSGiTestCase {
-
-    /**
-     * Instance where the ManagedServicePID is provided by the component type. 
-     */
-    ComponentInstance instance1;
-    /**
-     * Instance where the ManagedServicePID is provided by the instance. 
-     */
-    ComponentInstance instance2;
-    
-    /**
-     * Instance without configuration. 
-     */
-    ComponentInstance instance3;
-    
-    public void setUp() {
-        String type = "CONFIG-FooProviderType-4";
-        Properties p = new Properties();
-        p.put("instance.name","instance");
-        p.put("foo", "foo");
-        p.put("bar", "2");
-        p.put("baz", "baz");
-        instance1 = Utils.getComponentInstance(getContext(), type, p);
-        assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
-        
-        type = "CONFIG-FooProviderType-3";
-        Properties p1 = new Properties();
-        p1.put("instance.name","instance-2");
-        p1.put("foo", "foo");
-        p1.put("bar", "2");
-        p1.put("baz", "baz");
-        p1.put("managed.service.pid", "instance");
-        instance2 = Utils.getComponentInstance(getContext(), type, p1);
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance1 = null;
-        instance2 = null;
-    }
-    
-    public void testArchitectureForInstance1() {
-        Architecture arch = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance=instance)");
-        assertNotNull(arch);
-        
-        // Test on String representation.
-        String desc = arch.getInstanceDescription().getDescription().toString();
-        assertTrue(desc.contains("managed.service.pid=\"FooProvider-3\""));
-        
-        // Test on handler description
-        ConfigurationHandlerDescription hd = (ConfigurationHandlerDescription) arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:properties");
-        assertNotNull(hd);
-        
-        assertEquals(2, hd.getProperties().length);
-        assertEquals("FooProvider-3", hd.getManagedServicePid());
-
-    }
-    
-    public void testArchitectureForInstance2() {
-        Architecture arch = (Architecture) Utils.getServiceObject(context, Architecture.class.getName(), "(architecture.instance=instance-2)");
-        assertNotNull(arch);
-        
-        // Test on String representation.
-        String desc = arch.getInstanceDescription().getDescription().toString();
-        assertTrue(desc.contains("managed.service.pid=\"instance\""));
-        
-        // Test on handler description
-        ConfigurationHandlerDescription hd = (ConfigurationHandlerDescription) arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:properties");
-        assertNotNull(hd);
-        
-        assertEquals(2, hd.getProperties().length);
-        assertEquals("instance", hd.getManagedServicePid());
-
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
deleted file mode 100644
index 8bff9b3..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ConfigurationTestSuite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ConfigurationTestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Configuration Test Suite", bc);
-        ots.addTestSuite(SimpleProperties.class);
-        ots.addTestSuite(DynamicallyConfigurableProperties.class);
-        ots.addTestSuite(TestFieldProperties.class);
-        ots.addTestSuite(TestMethodProperties.class);
-        ots.addTestSuite(TestBothProperties.class);
-        ots.addTestSuite(TestSuperMethodProperties.class);
-        ots.addTestSuite(ManagedServiceConfigurableProperties.class);
-        ots.addTestSuite(TestComplexProperties.class);
-        ots.addTestSuite(TestPropertyModifier.class);
-        ots.addTestSuite(UpdatedMethod.class);
-        ots.addTestSuite(UpdatedMethodAndManagedServiceFactory.class);
-        ots.addTestSuite(UpdatedMethodAndManagedService.class);
-        ots.addTestSuite(UpdatedNoArgMethodAndManagedService.class);
-        ots.addTestSuite(UpdatedNoArgMethodAndManagedServiceFactory.class);
-        ots.addTestSuite(ArchitectureTest.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
deleted file mode 100644
index 4610f9d..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/DynamicallyConfigurableProperties.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class DynamicallyConfigurableProperties extends OSGiTestCase {
-
-	ComponentInstance instance, instance2;
-	
-	public void setUp() {
-		String type = "CONFIG-FooProviderType-3";
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		instance = Utils.getComponentInstance(getContext(), type, p1);
-		
-		Properties p2 = new Properties();
-        p2.put("instance.name","instance2");
-
-        instance2 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-	
-	public void tearDown() {
-		instance.dispose();
-		instance2.dispose();
-		instance2 = null;
-		instance = null;
-	}
-	
-	public void testStatic() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-		
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-		
-		
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-		
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-		getContext().ungetService(msRef);
-	}
-	
-	public void testStaticNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-        
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-        
-        
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-        
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-        getContext().ungetService(msRef);
-    }
-	
-	public void testDynamic() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-    	
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-    	
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-    	
-    	ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-    	
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-    	try {
-    		ms.updated(instance.getInstanceName(), conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-    	
-    	// Recheck props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-    	
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-    	
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-    	
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-    	
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-    }
-	
-	public void testDynamicNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-        
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-        
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-        
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-        
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-        
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-        
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-
-    public void testDynamicString() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "baz");
-		
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-		
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "oof");
-		conf.put("bar", "0");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-		
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		
-		assertEquals("Check foo equality", fooP, "oof");
-		assertEquals("Check bar equality", barP, new Integer(0));
-		assertEquals("Check baz equality", bazP, "zab");
-		
-		// Check field value
-		FooService fs = (FooService) getContext().getService(fooRef);
-		Properties p = fs.fooProps();
-		fooP = (String) p.get("foo");
-		barP = (Integer) p.get("bar");
-		
-		assertEquals("Check foo field equality", fooP, "oof");
-		assertEquals("Check bar field equality", barP, new Integer(0));
-		
-		getContext().ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-	
-	public void testPropagation() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "baz");
-		
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-		
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "foo");
-		conf.put("bar", new Integer(2));
-		conf.put("propagated1", "propagated");
-		conf.put("propagated2", new Integer(1));
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-		
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
-		String prop1 = (String) fooRef.getProperty("propagated1");
-		assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
-		Integer prop2 = (Integer) fooRef.getProperty("propagated2");
-		
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "zab");
-		assertEquals("Check propagated1 equality", prop1, "propagated");
-		assertEquals("Check propagated2 equality", prop2, new Integer(1));
-		
-		getContext().ungetService(msRef);
-	}
-	
-	public void testPropagationNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-        
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-        
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "foo");
-        conf.put("bar", new Integer(2));
-        conf.put("propagated1", "propagated");
-        conf.put("propagated2", new Integer(1));
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-        
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
-        String prop1 = (String) fooRef.getProperty("propagated1");
-        assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
-        Integer prop2 = (Integer) fooRef.getProperty("propagated2");
-        
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "zab");
-        assertEquals("Check propagated1 equality", prop1, "propagated");
-        assertEquals("Check propagated2 equality", prop2, new Integer(1));
-        
-        getContext().ungetService(msRef);
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
deleted file mode 100644
index 92997b2..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/ManagedServiceConfigurableProperties.java
+++ /dev/null
@@ -1,577 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveHandler;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
-
-public class ManagedServiceConfigurableProperties extends OSGiTestCase {
-
-	/**
-	 * Instance where the ManagedServicePID is provided by the component type. 
-	 */
-	ComponentInstance instance1;
-	/**
-     * Instance where the ManagedServicePID is provided by the instance. 
-     */
-	ComponentInstance instance2;
-	
-	/**
-     * Instance without configuration. 
-     */
-    ComponentInstance instance3;
-	
-	public void setUp() {
-	    String type = "CONFIG-FooProviderType-4";
-        Properties p = new Properties();
-        p.put("instance.name","instance");
-        p.put("foo", "foo");
-        p.put("bar", "2");
-        p.put("baz", "baz");
-        instance1 = Utils.getComponentInstance(getContext(), type, p);
-        assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
-        
-		type = "CONFIG-FooProviderType-3";
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance-2");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		p1.put("managed.service.pid", "instance");
-		instance2 = Utils.getComponentInstance(getContext(), type, p1);
-		
-		type = "CONFIG-FooProviderType-3";
-        Properties p2 = new Properties();
-        p2.put("instance.name","instance-3");
-        p2.put("managed.service.pid", "instance-3");
-        instance3 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-	}
-	
-	public void testStaticInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-		
-		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-		
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedService ms = (ManagedService) getContext().getService(msRef);
-		try {
-			ms.updated(conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-		
-		// Re-check props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-		getContext().ungetService(msRef);
-	}
-
-    public void testStaticInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, "foo");
-        assertEquals("Check bar equality -1", barP, new Integer(2));
-        assertEquals("Check baz equality -1", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedService availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testStaticInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        Object fooP = fooRef.getProperty("foo");
-        Object barP =  fooRef.getProperty("bar");
-        Object bazP =  fooRef.getProperty("baz");
-        // No values ... no properties.
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
-        assertNotNull("Check ManagedService availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamicInstance1() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-
-    	ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedService ms = (ManagedService) getContext().getService(msRef);
-    	try {
-    		ms.updated(conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-    	// Re-check props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-    }
-
-	public void testDynamicInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamicInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        Object fooP = fooRef.getProperty("foo");
-        Object barP =  fooRef.getProperty("bar");
-        Object bazP =  fooRef.getProperty("baz");
-     // No values ... no properties.
-        assertEquals("Check foo equality", fooP, null);
-        assertEquals("Check bar equality", barP, null);
-        assertEquals("Check baz equality", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-    public void testDynamicStringInstance1() {
-        assertEquals("Check instance1 state", ComponentInstance.VALID,instance1.getState());
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality - 1", fooP, "foo");
-		assertEquals("Check bar equality - 1", barP, new Integer(2));
-		assertEquals("Check baz equality - 1", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-		assertNotNull("Check ManagedService availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "oof");
-		conf.put("bar", "0");
-        assertEquals("Check instance1 state (2)", ComponentInstance.VALID,instance1.getState());
-		ManagedService ms = (ManagedService) getContext().getService(msRef);
-
-		PrimitiveHandler ph = (PrimitiveHandler) ms;
-		assertSame("Check the correct instance", ph.getInstanceManager(), instance1);
-
-		try {
-			ms.updated(conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-		assertEquals("Check instance1 state (3)", ComponentInstance.VALID,instance1.getState());
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality - 2", fooP, "oof");
-		assertEquals("Check bar equality - 2", barP, new Integer(0));
-		assertEquals("Check baz equality - 2", bazP, "zab");
-
-		// Check field value
-		FooService fs = (FooService) getContext().getService(fooRef);
-		Properties p = fs.fooProps();
-		fooP = (String) p.get("foo");
-		barP = (Integer) p.get("bar");
-
-		assertEquals("Check foo field equality", fooP, "oof");
-		assertEquals("Check bar field equality", barP, new Integer(0));
-
-		getContext().ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-
-    public void testDynamicStringInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedService availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", "0");
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testPropagationInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-		assertNotNull("Check ManagedService availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "foo");
-		conf.put("bar", new Integer(2));
-		conf.put("propagated1", "propagated");
-		conf.put("propagated2", new Integer(1));
-		ManagedService ms = (ManagedService) getContext().getService(msRef);
-		try {
-			ms.updated(conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
-		String prop1 = (String) fooRef.getProperty("propagated1");
-		assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
-		Integer prop2 = (Integer) fooRef.getProperty("propagated2");
-
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "zab");
-		assertEquals("Check propagated1 equality", prop1, "propagated");
-		assertEquals("Check propagated2 equality", prop2, new Integer(1));
-
-		getContext().ungetService(msRef);
-	}
-
-	public void testPropagationInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedService availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "foo");
-        conf.put("bar", new Integer(2));
-        conf.put("propagated1", "propagated");
-        conf.put("propagated2", new Integer(1));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
-        String prop1 = (String) fooRef.getProperty("propagated1");
-        assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
-        Integer prop2 = (Integer) fooRef.getProperty("propagated2");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "zab");
-        assertEquals("Check propagated1 equality", prop1, "propagated");
-        assertEquals("Check propagated2 equality", prop2, new Integer(1));
-
-        getContext().ungetService(msRef);
-    }
-
-	public void testPropagationInstance3() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        Object fooP = fooRef.getProperty("foo");
-        Object barP =  fooRef.getProperty("bar");
-        Object bazP =  fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, null);
-        assertEquals("Check bar equality", barP, null);
-        assertEquals("Check baz equality", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance-3");
-        assertNotNull("Check ManagedService availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "foo");
-        conf.put("bar", new Integer(2));
-        conf.put("propagated1", "propagated");
-        conf.put("propagated2", new Integer(1));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance3.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertNotNull("Check the propagated1 existency", fooRef.getProperty("propagated1"));
-        String prop1 = (String) fooRef.getProperty("propagated1");
-        assertNotNull("Check the propagated2 existency", fooRef.getProperty("propagated2"));
-        Integer prop2 = (Integer) fooRef.getProperty("propagated2");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "zab");
-        assertEquals("Check propagated1 equality", prop1, "propagated");
-        assertEquals("Check propagated2 equality", prop2, new Integer(1));
-
-        getContext().ungetService(msRef);
-    }
-	
-
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
deleted file mode 100644
index 9803664..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/SimpleProperties.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleProperties extends OSGiTestCase {
-	
-	ComponentInstance fooProvider1;
-	ComponentInstance fooProvider2;
-	ComponentInstance fooProvider3;
-	
-	public void setUp() {
-		String type = "CONFIG-FooProviderType-Conf";
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","FooProvider-1");
-		fooProvider1 = Utils.getComponentInstance(getContext(), type, p1);
-		
-		Properties p2 = new Properties();
-		p2.put("instance.name","FooProvider-2");
-		p2.put("int", new Integer(4));
-		p2.put("boolean", new Boolean(false));
-		p2.put("string", new String("bar"));
-		p2.put("strAProp", new String[] {"bar", "foo"});
-		p2.put("intAProp", new int[] {1, 2, 3});
-		fooProvider2 = Utils.getComponentInstance(getContext(), type, p2);
-		
-		Properties p3 = new Properties();
-        p3.put("instance.name","FooProvider-3");
-        fooProvider3 = Utils.getComponentInstance(getContext(), "CONFIG-FooProviderType-ConfNoValue", p3);
-	}
-	
-	public void tearDown() {
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		fooProvider3.dispose();
-		fooProvider1 = null;
-		fooProvider2 = null;
-		fooProvider3 = null;
-	}
-	
-	public void testComponentTypeConfiguration() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider1.getInstanceName());
-		assertNotNull("Check FooService availability", ref);
-		FooService fs = (FooService) getContext().getService(ref);
-		Properties toCheck = fs.fooProps();
-		
-		Integer intProp = (Integer) toCheck.get("intProp");
-		Boolean boolProp = (Boolean) toCheck.get("boolProp");
-		String strProp = (String) toCheck.get("strProp");
-		String[] strAProp = (String[]) toCheck.get("strAProp");
-		int[] intAProp = (int[]) toCheck.get("intAProp");
-		
-		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
-		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity (1)", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1) : " + strAProp[i] + " != " + v[i]); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1) : " + intAProp[i] + " != " + v2[i]); }
-		}
-		
-		// change the field value
-		assertTrue("Invoke the fs service", fs.foo());
-		toCheck = fs.fooProps();
-		
-		
-		//	Re-check the property (change)
-		intProp = (Integer) toCheck.get("intProp");
-		boolProp = (Boolean) toCheck.get("boolProp");
-		strProp = (String) toCheck.get("strProp");
-		strAProp = (String[]) toCheck.get("strAProp");
-		intAProp = (int[]) toCheck.get("intAProp");
-		
-		assertEquals("Check intProp equality (2) ("+intProp+")", intProp, new Integer(3));
-		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity (2)", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
-		}
-		assertNotNull("Check intAProp not nullity (2)", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2) : " + intAProp[i] + " != " + v2[i]); }
-		}
-		
-		fs = null;
-		getContext().ungetService(ref);
-	}
-	
-	public void testInstanceConfiguration() {
-		ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-2");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		FooService fs = (FooService) getContext().getService(sr);
-		Properties toCheck = fs.fooProps();
-		
-		// Check service properties
-		Integer intProp = (Integer) toCheck.get("intProp");
-		Boolean boolProp = (Boolean) toCheck.get("boolProp");
-		String strProp = (String) toCheck.get("strProp");
-		String[] strAProp = (String[]) toCheck.get("strAProp");
-		int[] intAProp = (int[]) toCheck.get("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(4));
-		assertEquals("Check longProp equality", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"bar", "foo"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		
-		assertTrue("invoke fs", fs.foo());
-		toCheck = fs.fooProps();
-		
-		// Re-check the property (change)
-		intProp = (Integer) toCheck.get("intProp");
-		boolProp = (Boolean) toCheck.get("boolProp");
-		strProp = (String) toCheck.get("strProp");
-		strAProp = (String[]) toCheck.get("strAProp");
-		intAProp = (int[]) toCheck.get("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(3));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		fs = null;
-		getContext().ungetService(sr);	
-	}
-	
-	public void testNoValue() {
-        ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-3");
-        assertNotNull("Check the availability of the FS service", sr);
-        
-        FooService fs = (FooService) getContext().getService(sr);
-        Properties toCheck = fs.fooProps();
-        
-        // Check service properties
-        Integer intProp = (Integer) toCheck.get("intProp");
-        Boolean boolProp = (Boolean) toCheck.get("boolProp");
-        String strProp = (String) toCheck.get("strProp");
-        String[] strAProp = (String[]) toCheck.get("strAProp");
-        int[] intAProp = (int[]) toCheck.get("intAProp");
-        
-        assertEquals("Check intProp equality", intProp, new Integer(0));
-        assertEquals("Check longProp equality", boolProp, new Boolean(false));
-        assertEquals("Check strProp equality", strProp, null);
-        assertNull("Check strAProp nullity", strAProp);
-        assertNull("Check intAProp  nullity", intAProp);
-       
-        assertTrue("invoke fs", fs.foo());
-        toCheck = fs.fooProps();
-        
-        // Re-check the property (change)
-        intProp = (Integer) toCheck.get("intProp");
-        boolProp = (Boolean) toCheck.get("boolProp");
-        strProp = (String) toCheck.get("strProp");
-        strAProp = (String[]) toCheck.get("strAProp");
-        intAProp = (int[]) toCheck.get("intAProp");
-        
-        assertEquals("Check intProp equality", intProp, new Integer(3));
-        assertEquals("Check longProp equality", boolProp, new Boolean(true));
-        assertEquals("Check strProp equality", strProp, new String("bar"));
-        assertNotNull("Check strAProp not nullity", strAProp);
-        String[] v = new String[] {"foo", "bar", "baz"};
-        for (int i = 0; i < strAProp.length; i++) {
-            if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-        }
-        assertNotNull("Check intAProp not nullity", intAProp);
-        int[] v2 = new int[] {3, 2, 1};
-        for (int i = 0; i < intAProp.length; i++) {
-            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-        }
-        
-        fs = null;
-        getContext().ungetService(sr);   
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
deleted file mode 100644
index 899a3e5..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestBothProperties.java
+++ /dev/null
@@ -1,856 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestBothProperties extends OSGiTestCase {
-    
-    ComponentInstance instance, instance2;
-
-    
-    public void setUp() {
-        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-BothConfigurableCheckService");
-        Properties props = new Properties();
-        props.put("instance.name","under-test");
-        props.put("b", "1");
-        props.put("s", "1");
-        props.put("i", "1");
-        props.put("l", "1");
-        props.put("d", "1");
-        props.put("f", "1");
-        props.put("c", "a");
-        props.put("bool", "true");
-        props.put("bs", "{1,2,3}");
-        props.put("ss", "{1,2,3}");
-        props.put("is", "{1,2,3}");
-        props.put("ls", "{1,2,3}");
-        props.put("ds", "{1,2,3}");
-        props.put("fs", "{1,2,3}");
-        props.put("cs", "{a,b,c}");
-        props.put("bools", "{true,true,true}");
-        props.put("string", "foo");
-        props.put("strings", "{foo, bar, baz}");
-        
-        try {
-            instance = fact.createComponentInstance(props);
-        } catch(Exception e) {
-           fail("Cannot create the under-test instance : " + e.getMessage());
-        }
-        
-        try {
-            instance2 = fact.createComponentInstance(null);
-        } catch(Exception e) {
-           fail("Cannot create the under-test instance2 : " + e.getMessage());
-        }
-        
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        instance2.dispose();
-        instance = null;
-        instance2 = null;
-    }
-    
-    public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-        Integer upb = (Integer) props.get("upb");
-        Integer ups = (Integer) props.get("ups");
-        Integer upi = (Integer) props.get("upi");
-        Integer upl = (Integer) props.get("upl");
-        Integer upd = (Integer) props.get("upd");
-        Integer upf = (Integer) props.get("upf");
-        Integer upc = (Integer) props.get("upc");
-        Integer upbool = (Integer) props.get("upbool");
-        
-        assertEquals("Check upb", upb, new Integer(1));
-        assertEquals("Check ups", ups, new Integer(1));
-        assertEquals("Check upi", upi, new Integer(1));
-        assertEquals("Check upl", upl, new Integer(1));
-        assertEquals("Check upd", upd, new Integer(1));
-        assertEquals("Check upf", upf, new Integer(1));
-        assertEquals("Check upc", upc, new Integer(1));
-        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-        upb = (Integer) props.get("upb");
-        ups = (Integer) props.get("ups");
-        upi = (Integer) props.get("upi");
-        upl = (Integer) props.get("upl");
-        upd = (Integer) props.get("upd");
-        upf = (Integer) props.get("upf");
-        upc = (Integer) props.get("upc");
-        upbool = (Integer) props.get("upbool");
-        
-        assertEquals("2) Check upb", upb, new Integer(2));
-        assertEquals("2) Check ups", ups, new Integer(2));
-        assertEquals("2) Check upi", upi, new Integer(2));
-        assertEquals("2) Check upl", upl, new Integer(2));
-        assertEquals("2) Check upd", upd, new Integer(2));
-        assertEquals("2) Check upf", upf, new Integer(2));
-        assertEquals("2) Check upc", upc, new Integer(2));
-        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-        Integer upb = (Integer) props.get("upb");
-        Integer ups = (Integer) props.get("ups");
-        Integer upi = (Integer) props.get("upi");
-        Integer upl = (Integer) props.get("upl");
-        Integer upd = (Integer) props.get("upd");
-        Integer upf = (Integer) props.get("upf");
-        Integer upc = (Integer) props.get("upc");
-        Integer upbool = (Integer) props.get("upbool");
-        
-        assertEquals("Check upb", upb, new Integer(1));
-        assertEquals("Check ups", ups, new Integer(1));
-        assertEquals("Check upi", upi, new Integer(1));
-        assertEquals("Check upl", upl, new Integer(1));
-        assertEquals("Check upd", upd, new Integer(1));
-        assertEquals("Check upf", upf, new Integer(1));
-        assertEquals("Check upc", upc, new Integer(1));
-        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-        upb = (Integer) props.get("upb");
-        ups = (Integer) props.get("ups");
-        upi = (Integer) props.get("upi");
-        upl = (Integer) props.get("upl");
-        upd = (Integer) props.get("upd");
-        upf = (Integer) props.get("upf");
-        upc = (Integer) props.get("upc");
-        upbool = (Integer) props.get("upbool");
-        
-        assertEquals("2) Check upb", upb, new Integer(2));
-        assertEquals("2) Check ups", ups, new Integer(2));
-        assertEquals("2) Check upi", upi, new Integer(2));
-        assertEquals("2) Check upl", upl, new Integer(2));
-        assertEquals("2) Check upd", upd, new Integer(2));
-        assertEquals("2) Check upf", upf, new Integer(2));
-        assertEquals("2) Check upc", upc, new Integer(2));
-        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-        Integer upb = (Integer) props.get("upbs");
-        Integer ups = (Integer) props.get("upss");
-        Integer upi = (Integer) props.get("upis");
-        Integer upl = (Integer) props.get("upls");
-        Integer upd = (Integer) props.get("upds");
-        Integer upf = (Integer) props.get("upfs");
-        Integer upc = (Integer) props.get("upcs");
-        Integer upbool = (Integer) props.get("upbools");
-        
-        assertEquals("Check upb", upb, new Integer(1));
-        assertEquals("Check ups", ups, new Integer(1));
-        assertEquals("Check upi", upi, new Integer(1));
-        assertEquals("Check upl", upl, new Integer(1));
-        assertEquals("Check upd", upd, new Integer(1));
-        assertEquals("Check upf", upf, new Integer(1));
-        assertEquals("Check upc", upc, new Integer(1));
-        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-        upb = (Integer) props.get("upbs");
-        ups = (Integer) props.get("upss");
-        upi = (Integer) props.get("upis");
-        upl = (Integer) props.get("upls");
-        upd = (Integer) props.get("upds");
-        upf = (Integer) props.get("upfs");
-        upc = (Integer) props.get("upcs");
-        upbool = (Integer) props.get("upbools");
-        
-        assertEquals("2) Check upb", upb, new Integer(2));
-        assertEquals("2) Check ups", ups, new Integer(2));
-        assertEquals("2) Check upi", upi, new Integer(2));
-        assertEquals("2) Check upl", upl, new Integer(2));
-        assertEquals("2) Check upd", upd, new Integer(2));
-        assertEquals("2) Check upf", upf, new Integer(2));
-        assertEquals("2) Check upc", upc, new Integer(2));
-        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-        Integer upb = (Integer) props.get("upbs");
-        Integer ups = (Integer) props.get("upss");
-        Integer upi = (Integer) props.get("upis");
-        Integer upl = (Integer) props.get("upls");
-        Integer upd = (Integer) props.get("upds");
-        Integer upf = (Integer) props.get("upfs");
-        Integer upc = (Integer) props.get("upcs");
-        Integer upbool = (Integer) props.get("upbools");
-        
-        assertEquals("Check upb", upb, new Integer(1));
-        assertEquals("Check ups", ups, new Integer(1));
-        assertEquals("Check upi", upi, new Integer(1));
-        assertEquals("Check upl", upl, new Integer(1));
-        assertEquals("Check upd", upd, new Integer(1));
-        assertEquals("Check upf", upf, new Integer(1));
-        assertEquals("Check upc", upc, new Integer(1));
-        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-        upb = (Integer) props.get("upbs");
-        ups = (Integer) props.get("upss");
-        upi = (Integer) props.get("upis");
-        upl = (Integer) props.get("upls");
-        upd = (Integer) props.get("upds");
-        upf = (Integer) props.get("upfs");
-        upc = (Integer) props.get("upcs");
-        upbool = (Integer) props.get("upbools");
-        
-        assertEquals("2) Check upb", upb, new Integer(2));
-        assertEquals("2) Check ups", ups, new Integer(2));
-        assertEquals("2) Check upi", upi, new Integer(2));
-        assertEquals("2) Check upl", upl, new Integer(2));
-        assertEquals("2) Check upd", upd, new Integer(2));
-        assertEquals("2) Check upf", upf, new Integer(2));
-        assertEquals("2) Check upc", upc, new Integer(2));
-        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-        Integer upString = (Integer) props.get("upstring");
-        Integer upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("Check upString", upString, new Integer(1));
-        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-        upString = (Integer) props.get("upstring");
-        upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("2) Check upstring", upString, new Integer(2));
-        assertEquals("2) Check upstrings", upStrings, new Integer(2));
-    }
-
-    public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-        Integer upString = (Integer) props.get("upstring");
-        Integer upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("Check upString", upString, new Integer(1));
-        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-        upString = (Integer) props.get("upstring");
-        upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("2) Check upstring", upString, new Integer(2));
-        assertEquals("2) Check upstrings", upStrings, new Integer(2));
-    }
-    
-    private void reconfigure(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", new Byte("2"));
-        props2.put("s", new Short("2"));
-        props2.put("i", new Integer("2"));
-        props2.put("l", new Long("2"));
-        props2.put("d", new Double("2"));
-        props2.put("f", new Float("2"));
-        props2.put("c", new Character('b'));
-        props2.put("bool", new Boolean(false));
-        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
-        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
-        props2.put("is", new int[]{3,2,1});
-        props2.put("ls", new long[]{3,2,1});
-        props2.put("ds", new double[]{3,2,1});
-        props2.put("fs", new float[]{3,2,1});
-        props2.put("cs", new char[]{'c','b','a'});
-        props2.put("bools", new boolean[]{false,false,false});
-        props2.put("string", "bar");
-        props2.put("strings", new String[]{"baz", "bar", "foo"});
-        
-        ci.reconfigure(props2);
-    }
-    
-    private void reconfigureString(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", "2");
-        props2.put("s", "2");
-        props2.put("i", "2");
-        props2.put("l", "2");
-        props2.put("d", "2");
-        props2.put("f", "2");
-        props2.put("c", "b");
-        props2.put("bool", "false");
-        props2.put("bs", "{3, 2,1}");
-        props2.put("ss", "{3, 2,1}");
-        props2.put("is", "{3, 2,1}");
-        props2.put("ls", "{3, 2,1}");
-        props2.put("ds", "{3, 2,1}");
-        props2.put("fs", "{3, 2,1}");
-        props2.put("cs", "{c, b , a}");
-        props2.put("bools", "{false,false,false}");
-        props2.put("string", "bar");
-        props2.put("strings", "{baz, bar, foo}");
-        
-        ci.reconfigure(props2);
-    }
-
-    public void testConfigurationPrimitiveNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("0"));
-        assertEquals("Check s", s, new Short("0"));
-        assertEquals("Check i", i, new Integer("0"));
-        assertEquals("Check l", l, new Long("0"));
-        assertEquals("Check d", d, new Double("0"));
-        assertEquals("Check f", f, new Float("0"));
-        assertEquals("Check c", c, new Character((char) 0));
-        assertEquals("Check bool", bool, new Boolean(false));
-        
-        Integer upb = (Integer) props.get("upb");
-        Integer ups = (Integer) props.get("ups");
-        Integer upi = (Integer) props.get("upi");
-        Integer upl = (Integer) props.get("upl");
-        Integer upd = (Integer) props.get("upd");
-        Integer upf = (Integer) props.get("upf");
-        Integer upc = (Integer) props.get("upc");
-        Integer upbool = (Integer) props.get("upbool");
-        
-        assertEquals("Check upb", upb, new Integer(0));
-        assertEquals("Check ups", ups, new Integer(0));
-        assertEquals("Check upi", upi, new Integer(0));
-        assertEquals("Check upl", upl, new Integer(0));
-        assertEquals("Check upd", upd, new Integer(0));
-        assertEquals("Check upf", upf, new Integer(0));
-        assertEquals("Check upc", upc, new Integer(0));
-        assertEquals("Check upbool", upbool, new Integer(0));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-        upb = (Integer) props.get("upb");
-        ups = (Integer) props.get("ups");
-        upi = (Integer) props.get("upi");
-        upl = (Integer) props.get("upl");
-        upd = (Integer) props.get("upd");
-        upf = (Integer) props.get("upf");
-        upc = (Integer) props.get("upc");
-        upbool = (Integer) props.get("upbool");
-        
-        assertEquals("2) Check upb", upb, new Integer(1));
-        assertEquals("2) Check ups", ups, new Integer(1));
-        assertEquals("2) Check upi", upi, new Integer(1));
-        assertEquals("2) Check upl", upl, new Integer(1));
-        assertEquals("2) Check upd", upd, new Integer(1));
-        assertEquals("2) Check upf", upf, new Integer(1));
-        assertEquals("2) Check upc", upc, new Integer(1));
-        //assertEquals("2) Check upbool", upbool, new Integer(1)); // TODO Why 0 ???
-        
-    }
-
-    public void testConfigurationPrimitiveArraysNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertNull("Check b nullity", b);
-        assertNull("Check s nullity", s);
-        assertNull("Check i nullity", i);
-        assertNull("Check l nullity", l);
-        assertNull("Check d nullity", d);
-        assertNull("Check f nullity", f);
-        assertNull("Check c nullity", c);
-        assertNull("Check bool nullity", bool);
-        
-        Integer upb = (Integer) props.get("upbs");
-        Integer ups = (Integer) props.get("upss");
-        Integer upi = (Integer) props.get("upis");
-        Integer upl = (Integer) props.get("upls");
-        Integer upd = (Integer) props.get("upds");
-        Integer upf = (Integer) props.get("upfs");
-        Integer upc = (Integer) props.get("upcs");
-        Integer upbool = (Integer) props.get("upbools");
-        
-        assertEquals("Check upb", upb, new Integer(0));
-        assertEquals("Check ups", ups, new Integer(0));
-        assertEquals("Check upi", upi, new Integer(0));
-        assertEquals("Check upl", upl, new Integer(0));
-        assertEquals("Check upd", upd, new Integer(0));
-        assertEquals("Check upf", upf, new Integer(0));
-        assertEquals("Check upc", upc, new Integer(0));
-        assertEquals("Check upbool", upbool, new Integer(0));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-        upb = (Integer) props.get("upbs");
-        ups = (Integer) props.get("upss");
-        upi = (Integer) props.get("upis");
-        upl = (Integer) props.get("upls");
-        upd = (Integer) props.get("upds");
-        upf = (Integer) props.get("upfs");
-        upc = (Integer) props.get("upcs");
-        upbool = (Integer) props.get("upbools");
-        
-        assertEquals("2) Check upb", upb, new Integer(1));
-        assertEquals("2) Check ups", ups, new Integer(1));
-        assertEquals("2) Check upi", upi, new Integer(1));
-        assertEquals("2) Check upl", upl, new Integer(1));
-        assertEquals("2) Check upd", upd, new Integer(1));
-        assertEquals("2) Check upf", upf, new Integer(1));
-        assertEquals("2) Check upc", upc, new Integer(1));
-        assertEquals("2) Check upbool", upbool, new Integer(1));
-        
-    }
-
-    public void testConfigurationObjNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, null);
-        assertEquals("Check strings", ss, null);
-
-        
-        Integer upString = (Integer) props.get("upstring");
-        Integer upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("Check upString", upString, new Integer(0));
-        assertEquals("Check upStrings", upStrings, new Integer(0));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-        upString = (Integer) props.get("upstring");
-        upStrings = (Integer) props.get("upstrings");
-        
-        assertEquals("2) Check upstring", upString, new Integer(1));
-        assertEquals("2) Check upstrings", upStrings, new Integer(1));
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java
deleted file mode 100644
index dc33f52..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestComplexProperties.java
+++ /dev/null
@@ -1,189 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestComplexProperties extends OSGiTestCase {
-    
-    private ServiceReference m_ref;
-    private CheckService m_check;
-    
-    public void setUp() {
-       m_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "complex");
-       assertNotNull("Complex service availability", m_ref);
-       m_check = (CheckService) getContext().getService(m_ref);
-    }
-    
-    public void tearDown() {
-        m_check = null;
-        getContext().ungetService(m_ref);
-    }
-    
-    public void testArray() {
-        String[] array = (String[]) m_check.getProps().get("array");
-        assertEquals("Array size", 2, array.length);
-        assertEquals("Array[0]", "a", array[0]);
-        assertEquals("Array[1]", "b", array[1]);
-    }
-    
-    public void testList() {
-        List list = (List) m_check.getProps().get("list");
-        assertEquals("List size", 2, list.size());
-        assertEquals("List[0]", "a", list.get(0));
-        assertEquals("List[1]", "b", list.get(1));
-    }
-    
-    public void testMap() {
-        Map map = (Map) m_check.getProps().get("map");
-        assertEquals("Map size", 2, map.size());
-        assertEquals("Map[a]", "a", map.get("a"));
-        assertEquals("Map[b]", "b", map.get("b"));
-    }
-    
-    public void testDictionary() {
-        Dictionary dict = (Dictionary) m_check.getProps().get("dict");
-        assertEquals("Map size", 2, dict.size());
-        assertEquals("Map[a]", "a", dict.get("a"));
-        assertEquals("Map[b]", "b", dict.get("b"));
-    }
-    
-    public void testComplexArray() {
-        Object[] array = (Object[]) m_check.getProps().get("complex-array");
-        assertEquals("Array size", 2, array.length);
-        assertTrue("Array[0] type", array[0] instanceof List);
-        assertTrue("Array[1] type", array[1] instanceof List);
-        List list = (List) array[0];
-        assertEquals("List size", 2, list.size());
-        assertEquals("List[0]", "a", list.get(0));
-        assertEquals("List[1]", "b", list.get(1));
-        list = (List) array[1];
-        assertEquals("List size - 2", 2, list.size());
-        assertEquals("List[0] - 2", "c", list.get(0));
-        assertEquals("List[1] - 2", "d", list.get(1));
-    }
-    
-    public void testComplexList() {
-        List list = (List) m_check.getProps().get("complex-list");
-        assertEquals("List size", 2, list.size());
-        assertTrue("List[0] type", list.get(0) instanceof List);
-        assertTrue("List[1] type", list.get(1) instanceof List);
-        List list1 = (List) list.get(0);
-        assertEquals("List size - 1", 2, list1.size());
-        assertEquals("List[0] - 1", "a", list1.get(0));
-        assertEquals("List[1] - 1", "b", list1.get(1));
-        list1 = (List) list.get(1);
-        assertEquals("List size - 2", 2, list1.size());
-        assertEquals("List[0] - 2", "c", list1.get(0));
-        assertEquals("List[1] - 2", "d", list1.get(1));
-    }
-    
-    public void testComplexMap() {
-        Map map = (Map) m_check.getProps().get("complex-map");
-        assertEquals("List size", 2, map.size());
-        assertTrue("List[0] type", map.get("a") instanceof List);
-        assertTrue("List[1] type", map.get("b") instanceof List);
-        List list = (List) map.get("a");
-        assertEquals("List size - 1", 2, list.size());
-        assertEquals("List[0] - 1", "a", list.get(0));
-        assertEquals("List[1] - 1", "b", list.get(1));
-        list = (List) map.get("b");
-        assertEquals("List size - 2", 2, list.size());
-        assertEquals("List[0] - 2", "c", list.get(0));
-        assertEquals("List[1] - 2", "d", list.get(1));
-    }
-    
-    public void testServiceArray() {
-        String[] array = (String[]) m_ref.getProperty("array");
-        assertEquals("Array size", 2, array.length);
-        assertEquals("Array[0]", "a", array[0]);
-        assertEquals("Array[1]", "b", array[1]);
-    }
-    
-    public void testServiceList() {
-        List list = (List) m_ref.getProperty("list");
-        assertEquals("List size", 2, list.size());
-        assertEquals("List[0]", "a", list.get(0));
-        assertEquals("List[1]", "b", list.get(1));
-    }
-    
-    public void testServiceMap() {
-        Map map = (Map) m_ref.getProperty("map");
-        assertEquals("Map size", 2, map.size());
-        assertEquals("Map[a]", "a", map.get("a"));
-        assertEquals("Map[b]", "b", map.get("b"));
-    }
-    
-    public void testServiceDictionary() {
-        Dictionary dict = (Dictionary) m_ref.getProperty("dict");
-        assertEquals("Map size", 2, dict.size());
-        assertEquals("Map[a]", "a", dict.get("a"));
-        assertEquals("Map[b]", "b", dict.get("b"));
-    }
-    
-    public void testServiceComplexArray() {
-        Object[] array = (Object[]) m_ref.getProperty("complex-array");
-        assertEquals("Array size", 2, array.length);
-        assertTrue("Array[0] type", array[0] instanceof List);
-        assertTrue("Array[1] type", array[1] instanceof List);
-        List list = (List) array[0];
-        assertEquals("List size", 2, list.size());
-        assertEquals("List[0]", "a", list.get(0));
-        assertEquals("List[1]", "b", list.get(1));
-        list = (List) array[1];
-        assertEquals("List size - 2", 2, list.size());
-        assertEquals("List[0] - 2", "c", list.get(0));
-        assertEquals("List[1] - 2", "d", list.get(1));
-    }
-    
-    public void testServiceComplexList() {
-        List list = (List) m_ref.getProperty("complex-list");
-        assertEquals("List size", 2, list.size());
-        assertTrue("List[0] type", list.get(0) instanceof List);
-        assertTrue("List[1] type", list.get(1) instanceof List);
-        List list1 = (List) list.get(0);
-        assertEquals("List size - 1", 2, list1.size());
-        assertEquals("List[0] - 1", "a", list1.get(0));
-        assertEquals("List[1] - 1", "b", list1.get(1));
-        list1 = (List) list.get(1);
-        assertEquals("List size - 2", 2, list1.size());
-        assertEquals("List[0] - 2", "c", list1.get(0));
-        assertEquals("List[1] - 2", "d", list1.get(1));
-    }
-    
-    public void testServiceComplexMap() {
-        Map map = (Map) m_ref.getProperty("complex-map");
-        assertEquals("List size", 2, map.size());
-        assertTrue("List[0] type", map.get("a") instanceof List);
-        assertTrue("List[1] type", map.get("b") instanceof List);
-        List list = (List) map.get("a");
-        assertEquals("List size - 1", 2, list.size());
-        assertEquals("List[0] - 1", "a", list.get(0));
-        assertEquals("List[1] - 1", "b", list.get(1));
-        list = (List) map.get("b");
-        assertEquals("List size - 2", 2, list.size());
-        assertEquals("List[0] - 2", "c", list.get(0));
-        assertEquals("List[1] - 2", "d", list.get(1));
-    }
-    
-    public void testServiceEmptyArray() {
-        String[] array = (String[]) m_ref.getProperty("empty-array");
-        assertEquals("Array size", 0, array.length);
-    }
-    
-    public void testServiceEmptyList() {
-        List list = (List) m_ref.getProperty("empty-list");
-        assertEquals("List size", 0, list.size());
-    }
-    
-    public void testServiceEmptyMap() {
-        Map map = (Map) m_ref.getProperty("empty-map");
-        assertEquals("Map size", 0, map.size());
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
deleted file mode 100644
index 0339b3f..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestFieldProperties.java
+++ /dev/null
@@ -1,754 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestFieldProperties extends OSGiTestCase {
-    
-    ComponentInstance instance;
-    ComponentInstance instance2;
-    
-    public void setUp() {
-        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-FieldConfigurableCheckService");
-        Properties props = new Properties();
-        props.put("instance.name","under-test");
-        props.put("b", "1");
-        props.put("s", "1");
-        props.put("i", "1");
-        props.put("l", "1");
-        props.put("d", "1");
-        props.put("f", "1");
-        props.put("c", "a");
-        props.put("bool", "true");
-        props.put("bs", "{1,2,3}");
-        props.put("ss", "{1,2,3}");
-        props.put("is", "{1,2,3}");
-        props.put("ls", "{1,2,3}");
-        props.put("ds", "{1,2,3}");
-        props.put("fs", "{1,2,3}");
-        props.put("cs", "{a,b,c}");
-        props.put("bools", "{true,true,true}");
-        props.put("string", "foo");
-        props.put("strings", "{foo, bar, baz}");
-        
-        try {
-            instance = fact.createComponentInstance(props);
-        } catch(Exception e) {
-           fail("Cannot create the under-test instance : " + e.getMessage());
-        }
-        
-        try {
-            instance2 = fact.createComponentInstance(null);
-        } catch (Exception e) {
-            e.printStackTrace();
-            fail("Cannot create the instance : " + e.getMessage());
-
-        }
-
-        
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        instance2.dispose();
-        instance = null;
-        instance2 = null;
-    }
-    
-    public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-    }
-    
-    public void testConfigurationPrimitiveNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("0"));
-        assertEquals("Check s", s, new Short("0"));
-        assertEquals("Check i", i, new Integer("0"));
-        assertEquals("Check l", l, new Long("0"));
-        assertEquals("Check d", d, new Double("0"));
-        assertEquals("Check f", f, new Float("0"));
-        assertEquals("Check c", c, new Character((char) 0));
-        assertEquals("Check bool", bool, new Boolean(false));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-    }
-
-    public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-    }
-    
-    public void testConfigurationPrimitiveStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("0"));
-        assertEquals("Check s", s, new Short("0"));
-        assertEquals("Check i", i, new Integer("0"));
-        assertEquals("Check l", l, new Long("0"));
-        assertEquals("Check d", d, new Double("0"));
-        assertEquals("Check f", f, new Float("0"));
-        assertEquals("Check c", c, new Character((char) 0));
-        assertEquals("Check bool", bool, new Boolean(false));
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-    }
-    
-    public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-    }
-    
-    public void testConfigurationPrimitiveArraysNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertNull("Check b nullity", b);
-        assertNull("Check s nullity", s);
-        assertNull("Check i nullity", i);
-        assertNull("Check l nullity", l);
-        assertNull("Check d nullity", d);
-        assertNull("Check f nullity", f);
-        assertNull("Check c nullity", c);
-        assertNull("Check bool nullity", bool);
-   
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-    }
-
-    public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-    }
-    
-    public void testConfigurationPrimitiveArraysStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertNull("Check b nullity", b);
-        assertNull("Check s nullity", s);
-        assertNull("Check i nullity", i);
-        assertNull("Check l nullity", l);
-        assertNull("Check d nullity", d);
-        assertNull("Check f nullity", f);
-        assertNull("Check c nullity", c);
-        assertNull("Check bool nullity", bool);
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-    }
-    
-    public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-    }
-    
-    public void testConfigurationObjNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, null);
-        assertEquals("Check strings", ss, null);
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-    }
-
-    public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-    }
-    
-    public void testConfigurationObjStringNoValue() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, null);
-        assertEquals("Check strings", ss, null);
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-    }
-    
-    private void reconfigure(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", new Byte("2"));
-        props2.put("s", new Short("2"));
-        props2.put("i", new Integer("2"));
-        props2.put("l", new Long("2"));
-        props2.put("d", new Double("2"));
-        props2.put("f", new Float("2"));
-        props2.put("c", new Character('b'));
-        props2.put("bool", new Boolean(false));
-        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
-        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
-        props2.put("is", new int[]{3,2,1});
-        props2.put("ls", new long[]{3,2,1});
-        props2.put("ds", new double[]{3,2,1});
-        props2.put("fs", new float[]{3,2,1});
-        props2.put("cs", new char[]{'c','b','a'});
-        props2.put("bools", new boolean[]{false,false,false});
-        props2.put("string", "bar");
-        props2.put("strings", new String[]{"baz", "bar", "foo"});
-        
-        ci.reconfigure(props2);
-    }
-    
-    private void reconfigureString(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", "2");
-        props2.put("s", "2");
-        props2.put("i", "2");
-        props2.put("l", "2");
-        props2.put("d", "2");
-        props2.put("f", "2");
-        props2.put("c", "b");
-        props2.put("bool", "false");
-        props2.put("bs", "{3, 2,1}");
-        props2.put("ss", "{3, 2,1}");
-        props2.put("is", "{3, 2,1}");
-        props2.put("ls", "{3, 2,1}");
-        props2.put("ds", "{3, 2,1}");
-        props2.put("fs", "{3, 2,1}");
-        props2.put("cs", "{c, b , a}");
-        props2.put("bools", "{false,false,false}");
-        props2.put("string", "bar");
-        props2.put("strings", "{baz, bar, foo}");
-        
-        ci.reconfigure(props2);
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
deleted file mode 100644
index c4a6f8d..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestMethodProperties.java
+++ /dev/null
@@ -1,1618 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestMethodProperties extends OSGiTestCase {
-    
-    ComponentInstance instance;
-    
-    ComponentInstance instance2;
-    
-    ComponentInstance instance3;
-
-    public void setUp() {
-        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-MethodConfigurableCheckService");
-        Properties props = new Properties();
-        props.put("instance.name","under-test");
-        props.put("b", "1");
-        props.put("s", "1");
-        props.put("i", "1");
-        props.put("l", "1");
-        props.put("d", "1");
-        props.put("f", "1");
-        props.put("c", "a");
-        props.put("bool", "true");
-        props.put("bs", "{1,2,3}");
-        props.put("ss", "{1,2,3}");
-        props.put("is", "{1,2,3}");
-        props.put("ls", "{1,2,3}");
-        props.put("ds", "{1,2,3}");
-        props.put("fs", "{1,2,3}");
-        props.put("cs", "{a,b,c}");
-        props.put("bools", "{true,true,true}");
-        props.put("string", "foo");
-        props.put("strings", "{foo, bar, baz}");
-        
-        try {
-            instance = fact.createComponentInstance(props);
-        } catch(Exception e) {
-           fail("Cannot create the under-test instance : " + e.getMessage());
-        }
-        
-        Properties props2 = new Properties();
-        props2.put("instance.name","under-test-2");
-        props2.put("b", new Byte("1"));
-        props2.put("s", new Short("1"));
-        props2.put("i", new Integer("1"));
-        props2.put("l", new Long("1"));
-        props2.put("d", new Double("1"));
-        props2.put("f", new Float("1"));
-        props2.put("c", new Character('a'));
-        props2.put("bool", new Boolean(true));
-        props2.put("bs", new byte[] {1,2,3});
-        props2.put("ss", new short[] {1,2,3});
-        props2.put("is", new int[] {1,2,3});
-        props2.put("ls", new long[] {1,2,3});
-        props2.put("ds", new double[] {1,2,3});
-        props2.put("fs", new float[] {1,2,3});
-        props2.put("cs", new char[] {'a','b','c'});
-        props2.put("bools", new boolean[] {true,true,true});
-        props2.put("string", "foo");
-        props2.put("strings", new String[] {"foo", "bar", "baz"});
-        
-        try {
-            instance2 = fact.createComponentInstance(props2);
-        } catch(Exception e) {
-           e.printStackTrace();
-           fail("Cannot create the under-test instance 2 : " + e.getMessage());
-        }
-        
-        try {
-            instance3 = fact.createComponentInstance(null);
-        } catch(Exception e) {
-           e.printStackTrace();
-           fail("Cannot create the under-test instance 3 : " + e.getMessage());
-        }
-        
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance = null;
-        instance2 = null;
-        instance3 = null;
-    }
-    
-    public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-//        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigure(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-
-    public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigureString(instance);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-    
-    public void testConfigurationPrimitive2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitive2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationPrimitiveArrays2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveArrays2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationObj2() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigure(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-
-    public void testConfigurationObj2String() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigureString(instance2);
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-    
-    private void reconfigure(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", new Byte("2"));
-        props2.put("s", new Short("2"));
-        props2.put("i", new Integer("2"));
-        props2.put("l", new Long("2"));
-        props2.put("d", new Double("2"));
-        props2.put("f", new Float("2"));
-        props2.put("c", new Character('b'));
-        props2.put("bool", new Boolean(false));
-        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
-        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
-        props2.put("is", new int[]{3,2,1});
-        props2.put("ls", new long[]{3,2,1});
-        props2.put("ds", new double[]{3,2,1});
-        props2.put("fs", new float[]{3,2,1});
-        props2.put("cs", new char[]{'c','b','a'});
-        props2.put("bools", new boolean[]{false,false,false});
-        props2.put("string", "bar");
-        props2.put("strings", new String[]{"baz", "bar", "foo"});
-        
-        ci.reconfigure(props2);
-    }
-    
-    private void reconfigureString(ComponentInstance ci) {
-        Properties props2 = new Properties();
-        props2.put("b", "2");
-        props2.put("s", "2");
-        props2.put("i", "2");
-        props2.put("l", "2");
-        props2.put("d", "2");
-        props2.put("f", "2");
-        props2.put("c", "b");
-        props2.put("bool", "false");
-        props2.put("bs", "{3, 2,1}");
-        props2.put("ss", "{3, 2,1}");
-        props2.put("is", "{3, 2,1}");
-        props2.put("ls", "{3, 2,1}");
-        props2.put("ds", "{3, 2,1}");
-        props2.put("fs", "{3, 2,1}");
-        props2.put("cs", "{c, b , a}");
-        props2.put("bools", "{false,false,false}");
-        props2.put("string", "bar");
-        props2.put("strings", "{baz, bar, foo}");
-        
-        ci.reconfigure(props2);
-    }
-
-    public void testConfigurationPrimitiveNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
-            
-            Byte b = (Byte) props.get("b");
-            Short s = (Short) props.get("s");
-            Integer i = (Integer) props.get("i");
-            Long l = (Long) props.get("l");
-            Double d = (Double) props.get("d");
-            Float f = (Float) props.get("f");
-            Character c = (Character) props.get("c");
-            Boolean bool = (Boolean) props.get("bool");
-                    
-            assertEquals("Check b", b, new Byte("0"));
-            assertEquals("Check s", s, new Short("0"));
-            assertEquals("Check i", i, new Integer("0"));
-            assertEquals("Check l", l, new Long("0"));
-            assertEquals("Check d", d, new Double("0"));
-            assertEquals("Check f", f, new Float("0"));
-            assertEquals("Check c", c, new Character((char) 0));
-            assertEquals("Check bool", bool, new Boolean("false"));
-            
-            Integer upb = (Integer) props.get("upb");
-            Integer ups = (Integer) props.get("ups");
-            Integer upi = (Integer) props.get("upi");
-            Integer upl = (Integer) props.get("upl");
-            Integer upd = (Integer) props.get("upd");
-            Integer upf = (Integer) props.get("upf");
-            Integer upc = (Integer) props.get("upc");
-            Integer upbool = (Integer) props.get("upbool");
-            
-            assertEquals("Check upb", upb, new Integer(0));
-            assertEquals("Check ups", ups, new Integer(0));
-            assertEquals("Check upi", upi, new Integer(0));
-            assertEquals("Check upl", upl, new Integer(0));
-            assertEquals("Check upd", upd, new Integer(0));
-            assertEquals("Check upf", upf, new Integer(0));
-            assertEquals("Check upc", upc, new Integer(0));
-            assertEquals("Check upbool", upbool, new Integer(0));
-            
-            reconfigure(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            b = (Byte) props.get("b");
-            s = (Short) props.get("s");
-            i = (Integer) props.get("i");
-            l = (Long) props.get("l");
-            d = (Double) props.get("d");
-            f = (Float) props.get("f");
-            c = (Character) props.get("c");
-            bool = (Boolean) props.get("bool");
-            
-            assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-            assertEquals("2) Check s", s, new Short("2"));
-            assertEquals("2) Check i", i, new Integer("2"));
-            assertEquals("2) Check l", l, new Long("2"));
-            assertEquals("2) Check d", d, new Double("2"));
-            assertEquals("2) Check f", f, new Float("2"));
-            assertEquals("2) Check c", c, new Character('b'));
-            assertEquals("2) Check bool", bool, new Boolean("false"));
-            
-            upb = (Integer) props.get("upb");
-            ups = (Integer) props.get("ups");
-            upi = (Integer) props.get("upi");
-            upl = (Integer) props.get("upl");
-            upd = (Integer) props.get("upd");
-            upf = (Integer) props.get("upf");
-            upc = (Integer) props.get("upc");
-            upbool = (Integer) props.get("upbool");
-            
-            assertEquals("2) Check upb", upb, new Integer(1));
-            assertEquals("2) Check ups", ups, new Integer(1));
-            assertEquals("2) Check upi", upi, new Integer(1));
-            assertEquals("2) Check upl", upl, new Integer(1));
-            assertEquals("2) Check upd", upd, new Integer(1));
-            assertEquals("2) Check upf", upf, new Integer(1));
-            assertEquals("2) Check upc", upc, new Integer(1));
-            assertEquals("2) Check upbool", upbool, new Integer(1));
-            
-        }
-
-    public void testConfigurationPrimitiveStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
-            
-            Byte b = (Byte) props.get("b");
-            Short s = (Short) props.get("s");
-            Integer i = (Integer) props.get("i");
-            Long l = (Long) props.get("l");
-            Double d = (Double) props.get("d");
-            Float f = (Float) props.get("f");
-            Character c = (Character) props.get("c");
-            Boolean bool = (Boolean) props.get("bool");
-                    
-            assertEquals("Check b", b, new Byte("0"));
-            assertEquals("Check s", s, new Short("0"));
-            assertEquals("Check i", i, new Integer("0"));
-            assertEquals("Check l", l, new Long("0"));
-            assertEquals("Check d", d, new Double("0"));
-            assertEquals("Check f", f, new Float("0"));
-            assertEquals("Check c", c, new Character((char) 0));
-            assertEquals("Check bool", bool, new Boolean("false"));
-            
-            Integer upb = (Integer) props.get("upb");
-            Integer ups = (Integer) props.get("ups");
-            Integer upi = (Integer) props.get("upi");
-            Integer upl = (Integer) props.get("upl");
-            Integer upd = (Integer) props.get("upd");
-            Integer upf = (Integer) props.get("upf");
-            Integer upc = (Integer) props.get("upc");
-            Integer upbool = (Integer) props.get("upbool");
-            
-            assertEquals("Check upb", upb, new Integer(0));
-            assertEquals("Check ups", ups, new Integer(0));
-            assertEquals("Check upi", upi, new Integer(0));
-            assertEquals("Check upl", upl, new Integer(0));
-            assertEquals("Check upd", upd, new Integer(0));
-            assertEquals("Check upf", upf, new Integer(0));
-            assertEquals("Check upc", upc, new Integer(0));
-            assertEquals("Check upbool", upbool, new Integer(0));
-            
-            reconfigureString(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            b = (Byte) props.get("b");
-            s = (Short) props.get("s");
-            i = (Integer) props.get("i");
-            l = (Long) props.get("l");
-            d = (Double) props.get("d");
-            f = (Float) props.get("f");
-            c = (Character) props.get("c");
-            bool = (Boolean) props.get("bool");
-            
-            assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-            assertEquals("2) Check s", s, new Short("2"));
-            assertEquals("2) Check i", i, new Integer("2"));
-            assertEquals("2) Check l", l, new Long("2"));
-            assertEquals("2) Check d", d, new Double("2"));
-            assertEquals("2) Check f", f, new Float("2"));
-            assertEquals("2) Check c", c, new Character('b'));
-            assertEquals("2) Check bool", bool, new Boolean("false"));
-            
-            upb = (Integer) props.get("upb");
-            ups = (Integer) props.get("ups");
-            upi = (Integer) props.get("upi");
-            upl = (Integer) props.get("upl");
-            upd = (Integer) props.get("upd");
-            upf = (Integer) props.get("upf");
-            upc = (Integer) props.get("upc");
-            upbool = (Integer) props.get("upbool");
-            
-            assertEquals("2) Check upb", upb, new Integer(1));
-            assertEquals("2) Check ups", ups, new Integer(1));
-            assertEquals("2) Check upi", upi, new Integer(1));
-            assertEquals("2) Check upl", upl, new Integer(1));
-            assertEquals("2) Check upd", upd, new Integer(1));
-            assertEquals("2) Check upf", upf, new Integer(1));
-            assertEquals("2) Check upc", upc, new Integer(1));
-            assertEquals("2) Check upbool", upbool, new Integer(1));
-            
-        }
-
-    public void testConfigurationPrimitiveArraysNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
- 
-                    
-            byte[] b = (byte[]) props.get("bs");
-            short[] s = (short[]) props.get("ss");
-            int[] i = (int[]) props.get("is");
-            long[] l = (long[]) props.get("ls");
-            double[] d = (double[]) props.get("ds");
-            float[] f = (float[]) props.get("fs");
-            char[] c = (char[]) props.get("cs");
-            boolean[] bool = (boolean[]) props.get("bools");
-                    
-            assertNull("Check b nullity", b);
-            assertNull("Check s nullity", s);
-            assertNull("Check i nullity", i);
-            assertNull("Check l nullity", l);
-            assertNull("Check d nullity", d);
-            assertNull("Check f nullity", f);
-            assertNull("Check c nullity", c);
-            assertNull("Check bool nullity", bool);
-            
-            Integer upb = (Integer) props.get("upbs");
-            Integer ups = (Integer) props.get("upss");
-            Integer upi = (Integer) props.get("upis");
-            Integer upl = (Integer) props.get("upls");
-            Integer upd = (Integer) props.get("upds");
-            Integer upf = (Integer) props.get("upfs");
-            Integer upc = (Integer) props.get("upcs");
-            Integer upbool = (Integer) props.get("upbools");
-            
-            assertEquals("Check upb", upb, new Integer(0));
-            assertEquals("Check ups", ups, new Integer(0));
-            assertEquals("Check upi", upi, new Integer(0));
-            assertEquals("Check upl", upl, new Integer(0));
-            assertEquals("Check upd", upd, new Integer(0));
-            assertEquals("Check upf", upf, new Integer(0));
-            assertEquals("Check upc", upc, new Integer(0));
-            assertEquals("Check upbool", upbool, new Integer(0));
-            
-            reconfigure(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            b = (byte[]) props.get("bs");
-            s = (short[]) props.get("ss");
-            i = (int[]) props.get("is");
-            l = (long[]) props.get("ls");
-            d = (double[]) props.get("ds");
-            f = (float[]) props.get("fs");
-            c = (char[]) props.get("cs");
-            bool = (boolean[]) props.get("bools");
-            
-            assertEquals("2) Check b 0", b[0], 3);
-            assertEquals("2) Check b 1", b[1], 2);
-            assertEquals("2) Check b 2", b[2], 1);
-            assertEquals("2) Check s 0", s[0], 3);
-            assertEquals("2) Check s 1", s[1], 2);
-            assertEquals("2) Check s 2", s[2], 1);
-            assertEquals("2) Check i 0", i[0], 3);
-            assertEquals("2) Check i 1", i[1], 2);
-            assertEquals("2) Check i 2", i[2], 1);
-            assertEquals("2) Check l 0", l[0], 3);
-            assertEquals("2) Check l 1", l[1], 2);
-            assertEquals("2) Check l 2", l[2], 1);
-            assertEquals("2) Check d 0", d[0], 3);
-            assertEquals("2) Check d 1", d[1], 2);
-            assertEquals("2) Check d 2", d[2], 1);
-            assertEquals("2) Check f 0", f[0], 3);
-            assertEquals("2) Check f 1", f[1], 2);
-            assertEquals("2) Check f 2", f[2], 1);
-            assertEquals("2) Check c 0", c[0], 'c');
-            assertEquals("2) Check c 1", c[1], 'b');
-            assertEquals("2) Check c 2", c[2], 'a');
-            assertFalse("2) Check bool 0", bool[0]);
-            assertFalse("2) Check bool 1", bool[0]);
-            assertFalse("2) Check bool 2", bool[0]);
-            
-            upb = (Integer) props.get("upbs");
-            ups = (Integer) props.get("upss");
-            upi = (Integer) props.get("upis");
-            upl = (Integer) props.get("upls");
-            upd = (Integer) props.get("upds");
-            upf = (Integer) props.get("upfs");
-            upc = (Integer) props.get("upcs");
-            upbool = (Integer) props.get("upbools");
-            
-            assertEquals("2) Check upb", upb, new Integer(1));
-            assertEquals("2) Check ups", ups, new Integer(1));
-            assertEquals("2) Check upi", upi, new Integer(1));
-            assertEquals("2) Check upl", upl, new Integer(1));
-            assertEquals("2) Check upd", upd, new Integer(1));
-            assertEquals("2) Check upf", upf, new Integer(1));
-            assertEquals("2) Check upc", upc, new Integer(1));
-            assertEquals("2) Check upbool", upbool, new Integer(1));
-            
-        }
-
-    public void testConfigurationPrimitiveArraysStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
-            
-            byte[] b = (byte[]) props.get("bs");
-            short[] s = (short[]) props.get("ss");
-            int[] i = (int[]) props.get("is");
-            long[] l = (long[]) props.get("ls");
-            double[] d = (double[]) props.get("ds");
-            float[] f = (float[]) props.get("fs");
-            char[] c = (char[]) props.get("cs");
-            boolean[] bool = (boolean[]) props.get("bools");
-            
-            assertNull("Check b nullity", b);
-            assertNull("Check s nullity", s);
-            assertNull("Check i nullity", i);
-            assertNull("Check l nullity", l);
-            assertNull("Check d nullity", d);
-            assertNull("Check f nullity", f);
-            assertNull("Check c nullity", c);
-            assertNull("Check bool nullity", bool);
-            
-            Integer upb = (Integer) props.get("upbs");
-            Integer ups = (Integer) props.get("upss");
-            Integer upi = (Integer) props.get("upis");
-            Integer upl = (Integer) props.get("upls");
-            Integer upd = (Integer) props.get("upds");
-            Integer upf = (Integer) props.get("upfs");
-            Integer upc = (Integer) props.get("upcs");
-            Integer upbool = (Integer) props.get("upbools");
-            
-            assertEquals("Check upb", upb, new Integer(0));
-            assertEquals("Check ups", ups, new Integer(0));
-            assertEquals("Check upi", upi, new Integer(0));
-            assertEquals("Check upl", upl, new Integer(0));
-            assertEquals("Check upd", upd, new Integer(0));
-            assertEquals("Check upf", upf, new Integer(0));
-            assertEquals("Check upc", upc, new Integer(0));
-            assertEquals("Check upbool", upbool, new Integer(0));
-            
-    
-            reconfigureString(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            b = (byte[]) props.get("bs");
-            s = (short[]) props.get("ss");
-            i = (int[]) props.get("is");
-            l = (long[]) props.get("ls");
-            d = (double[]) props.get("ds");
-            f = (float[]) props.get("fs");
-            c = (char[]) props.get("cs");
-            bool = (boolean[]) props.get("bools");
-            
-            assertEquals("2) Check b 0", b[0], 3);
-            assertEquals("2) Check b 1", b[1], 2);
-            assertEquals("2) Check b 2", b[2], 1);
-            assertEquals("2) Check s 0", s[0], 3);
-            assertEquals("2) Check s 1", s[1], 2);
-            assertEquals("2) Check s 2", s[2], 1);
-            assertEquals("2) Check i 0", i[0], 3);
-            assertEquals("2) Check i 1", i[1], 2);
-            assertEquals("2) Check i 2", i[2], 1);
-            assertEquals("2) Check l 0", l[0], 3);
-            assertEquals("2) Check l 1", l[1], 2);
-            assertEquals("2) Check l 2", l[2], 1);
-            assertEquals("2) Check d 0", d[0], 3);
-            assertEquals("2) Check d 1", d[1], 2);
-            assertEquals("2) Check d 2", d[2], 1);
-            assertEquals("2) Check f 0", f[0], 3);
-            assertEquals("2) Check f 1", f[1], 2);
-            assertEquals("2) Check f 2", f[2], 1);
-            assertEquals("2) Check c 0", c[0], 'c');
-            assertEquals("2) Check c 1", c[1], 'b');
-            assertEquals("2) Check c 2", c[2], 'a');
-            assertFalse("2) Check bool 0", bool[0]);
-            assertFalse("2) Check bool 1", bool[0]);
-            assertFalse("2) Check bool 2", bool[0]);
-            
-            upb = (Integer) props.get("upbs");
-            ups = (Integer) props.get("upss");
-            upi = (Integer) props.get("upis");
-            upl = (Integer) props.get("upls");
-            upd = (Integer) props.get("upds");
-            upf = (Integer) props.get("upfs");
-            upc = (Integer) props.get("upcs");
-            upbool = (Integer) props.get("upbools");
-            
-            assertEquals("2) Check upb", upb, new Integer(1));
-            assertEquals("2) Check ups", ups, new Integer(1));
-            assertEquals("2) Check upi", upi, new Integer(1));
-            assertEquals("2) Check upl", upl, new Integer(1));
-            assertEquals("2) Check upd", upd, new Integer(1));
-            assertEquals("2) Check upf", upf, new Integer(1));
-            assertEquals("2) Check upc", upc, new Integer(1));
-            assertEquals("2) Check upbool", upbool, new Integer(1));
-            
-        }
-
-    public void testConfigurationObjNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
-            
-            String s = (String) props.get("string");
-            String[] ss = (String[]) props.get("strings");
-                    
-            assertEquals("Check string", s, null);
-            assertEquals("Check strings", ss, null);
-
-            
-            Integer upString = (Integer) props.get("upstring");
-            Integer upStrings = (Integer) props.get("upstrings");
-            
-            assertEquals("Check upString", upString, new Integer(0));
-            assertEquals("Check upStrings", upStrings, new Integer(0));
-            
-            reconfigure(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            s = (String) props.get("string");
-            ss = (String[]) props.get("strings");
-                    
-            assertEquals("2) Check string", s, "bar");
-            assertEquals("2) Check strings 0", ss[0], "baz");
-            assertEquals("2) Check strings 1", ss[1], "bar");
-            assertEquals("2) Check strings 2", ss[2], "foo");
-            
-            upString = (Integer) props.get("upstring");
-            upStrings = (Integer) props.get("upstrings");
-            
-            assertEquals("2) Check upString", upString, new Integer(1));
-            assertEquals("2) Check upStrings", upStrings, new Integer(1));
-        }
-
-    public void testConfigurationObjStringNoValue() {
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            CheckService check = (CheckService) getContext().getService(ref);
-            Properties props = check.getProps();
-            
-            String s = (String) props.get("string");
-            String[] ss = (String[]) props.get("strings");
-                    
-            assertEquals("Check string", s, null);
-            assertEquals("Check strings", ss, null);
-
-            
-            Integer upString = (Integer) props.get("upstring");
-            Integer upStrings = (Integer) props.get("upstrings");
-            
-            assertEquals("Check upString", upString, new Integer(0));
-            assertEquals("Check upStrings", upStrings, new Integer(0));
-            
-            reconfigureString(instance3);
-            
-            ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-            assertNotNull("Test check service availability", ref);
-            check = (CheckService) getContext().getService(ref);
-            props = check.getProps();
-            
-            s = (String) props.get("string");
-            ss = (String[]) props.get("strings");
-                    
-            assertEquals("2) Check string", s, "bar");
-            assertEquals("2) Check strings 0", ss[0], "baz");
-            assertEquals("2) Check strings 1", ss[1], "bar");
-            assertEquals("2) Check strings 2", ss[2], "foo");
-            
-            upString = (Integer) props.get("upstring");
-            upStrings = (Integer) props.get("upstrings");
-            
-            assertEquals("2) Check upString", upString, new Integer(1));
-            assertEquals("2) Check upStrings", upStrings, new Integer(1));
-        }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
deleted file mode 100644
index 47ddc81..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestPropertyModifier.java
+++ /dev/null
@@ -1,76 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestPropertyModifier extends OSGiTestCase {
-    
-    public void testPropertyModifier() {
-        ComponentInstance ci = null; 
-        Factory factory =  Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.PropertyModifier");
-        Properties props = new Properties();
-        props.put("cls", new String[] {FooService.class.getName()});
-        try {
-            ci = factory.createComponentInstance(props);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        } 
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
-        assertNotNull("Check ref", ref);
-        
-        // Check the service property
-        // Not exposed here:
-        assertNull("Classes -0", ref.getProperty("classes"));
-        
-        CheckService check = (CheckService) getContext().getService(ref);
-        assertTrue(check.check());
-        
-        // Property exposed now.
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
-        Class[] str = (Class[]) ref.getProperty("classes");
-        assertEquals("Classes size", 1, str.length);
-        assertEquals("Classes[0]", FooService.class.getName(), str[0].getName());
-        
-        Properties p = check.getProps();
-        Class[] str2 = (Class[]) p.get("classes");
-        assertEquals("Classes size -2", 1, str2.length);
-        assertEquals("Classes[0] -2", FooService.class.getName(), str2[0].getName());
-        
-        Properties props2 = new Properties();
-        props2.put("cls", new String[] {FooService.class.getName(), CheckService.class.getName()});
-        try {
-            ci.reconfigure(props2);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        } 
-        
-        // Check the service property
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), ci.getInstanceName());
-        assertNotNull("Check ref", ref);
-        str = (Class[]) ref.getProperty("classes");
-        assertEquals("Classes size -3", 2, str.length);
-        assertEquals("Classes[0] -3", FooService.class.getName(), str[0].getName());
-        assertEquals("Classes[1] -3", CheckService.class.getName(), str[1].getName());
-
-        
-        check = (CheckService) getContext().getService(ref);
-        p = check.getProps();
-        str2 = (Class[]) p.get("classes");
-        assertEquals("Classes size -4", 2, str2.length);
-        assertEquals("Classes[0] -4", FooService.class.getName(), str2[0].getName());
-        assertEquals("Classes[1] -4", CheckService.class.getName(), str2[1].getName());
-        
-        ci.dispose();
-        getContext().ungetService(ref);
-        
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
deleted file mode 100644
index fc5ce65..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/TestSuperMethodProperties.java
+++ /dev/null
@@ -1,617 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TestSuperMethodProperties extends OSGiTestCase {
-    
-    ComponentInstance instance;
-
-    public void setUp() {
-        Factory fact = Utils.getFactoryByName(getContext(), "CONFIG-ParentMethodConfigurableCheckService");
-        Properties props = new Properties();
-        props.put("instance.name","under-test");
-        props.put("b", "1");
-        props.put("s", "1");
-        props.put("i", "1");
-        props.put("l", "1");
-        props.put("d", "1");
-        props.put("f", "1");
-        props.put("c", "a");
-        props.put("bool", "true");
-        props.put("bs", "{1,2,3}");
-        props.put("ss", "{1,2,3}");
-        props.put("is", "{1,2,3}");
-        props.put("ls", "{1,2,3}");
-        props.put("ds", "{1,2,3}");
-        props.put("fs", "{1,2,3}");
-        props.put("cs", "{a,b,c}");
-        props.put("bools", "{true,true,true}");
-        props.put("string", "foo");
-        props.put("strings", "{foo, bar, baz}");
-        
-        try {
-            instance = fact.createComponentInstance(props);
-        } catch (Exception e) {
-           fail("Cannot create the under-test instance : " + e.getMessage());
-        }
-        
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        instance = null;
-    }
-    
-    public void testConfigurationPrimitive() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        Byte b = (Byte) props.get("b");
-        Short s = (Short) props.get("s");
-        Integer i = (Integer) props.get("i");
-        Long l = (Long) props.get("l");
-        Double d = (Double) props.get("d");
-        Float f = (Float) props.get("f");
-        Character c = (Character) props.get("c");
-        Boolean bool = (Boolean) props.get("bool");
-                
-        assertEquals("Check b", b, new Byte("1"));
-        assertEquals("Check s", s, new Short("1"));
-        assertEquals("Check i", i, new Integer("1"));
-        assertEquals("Check l", l, new Long("1"));
-        assertEquals("Check d", d, new Double("1"));
-        assertEquals("Check f", f, new Float("1"));
-        assertEquals("Check c", c, new Character('a'));
-        assertEquals("Check bool", bool, new Boolean("true"));
-        
-//        Integer upb = (Integer) props.get("upb");
-//        Integer ups = (Integer) props.get("ups");
-//        Integer upi = (Integer) props.get("upi");
-//        Integer upl = (Integer) props.get("upl");
-//        Integer upd = (Integer) props.get("upd");
-//        Integer upf = (Integer) props.get("upf");
-//        Integer upc = (Integer) props.get("upc");
-//        Integer upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (Byte) props.get("b");
-        s = (Short) props.get("s");
-        i = (Integer) props.get("i");
-        l = (Long) props.get("l");
-        d = (Double) props.get("d");
-        f = (Float) props.get("f");
-        c = (Character) props.get("c");
-        bool = (Boolean) props.get("bool");
-        
-        assertEquals("2) Check b ("+b+")", b, new Byte("2"));
-        assertEquals("2) Check s", s, new Short("2"));
-        assertEquals("2) Check i", i, new Integer("2"));
-        assertEquals("2) Check l", l, new Long("2"));
-        assertEquals("2) Check d", d, new Double("2"));
-        assertEquals("2) Check f", f, new Float("2"));
-        assertEquals("2) Check c", c, new Character('b'));
-        assertEquals("2) Check bool", bool, new Boolean("false"));
-        
-//        upb = (Integer) props.get("upb");
-//        ups = (Integer) props.get("ups");
-//        upi = (Integer) props.get("upi");
-//        upl = (Integer) props.get("upl");
-//        upd = (Integer) props.get("upd");
-//        upf = (Integer) props.get("upf");
-//        upc = (Integer) props.get("upc");
-//        upbool = (Integer) props.get("upbool");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationPrimitiveArrays() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigure();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-
-    public void testConfigurationPrimitiveArraysString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        byte[] b = (byte[]) props.get("bs");
-        short[] s = (short[]) props.get("ss");
-        int[] i = (int[]) props.get("is");
-        long[] l = (long[]) props.get("ls");
-        double[] d = (double[]) props.get("ds");
-        float[] f = (float[]) props.get("fs");
-        char[] c = (char[]) props.get("cs");
-        boolean[] bool = (boolean[]) props.get("bools");
-                
-        assertEquals("Check b 0", b[0], 1);
-        assertEquals("Check b 1", b[1], 2);
-        assertEquals("Check b 2", b[2], 3);
-        assertEquals("Check s 0", s[0], 1);
-        assertEquals("Check s 1", s[1], 2);
-        assertEquals("Check s 2", s[2], 3);
-        assertEquals("Check i 0", i[0], 1);
-        assertEquals("Check i 1", i[1], 2);
-        assertEquals("Check i 2", i[2], 3);
-        assertEquals("Check l 0", l[0], 1);
-        assertEquals("Check l 1", l[1], 2);
-        assertEquals("Check l 2", l[2], 3);
-        assertEquals("Check d 0", d[0], 1);
-        assertEquals("Check d 1", d[1], 2);
-        assertEquals("Check d 2", d[2], 3);
-        assertEquals("Check f 0", f[0], 1);
-        assertEquals("Check f 1", f[1], 2);
-        assertEquals("Check f 2", f[2], 3);
-        assertEquals("Check c 0", c[0], 'a');
-        assertEquals("Check c 1", c[1], 'b');
-        assertEquals("Check c 2", c[2], 'c');
-        assertTrue("Check bool 0", bool[0]);
-        assertTrue("Check bool 1", bool[0]);
-        assertTrue("Check bool 2", bool[0]);
-        
-//        Integer upb = (Integer) props.get("upbs");
-//        Integer ups = (Integer) props.get("upss");
-//        Integer upi = (Integer) props.get("upis");
-//        Integer upl = (Integer) props.get("upls");
-//        Integer upd = (Integer) props.get("upds");
-//        Integer upf = (Integer) props.get("upfs");
-//        Integer upc = (Integer) props.get("upcs");
-//        Integer upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("Check upb", upb, new Integer(1));
-//        assertEquals("Check ups", ups, new Integer(1));
-//        assertEquals("Check upi", upi, new Integer(1));
-//        assertEquals("Check upl", upl, new Integer(1));
-//        assertEquals("Check upd", upd, new Integer(1));
-//        assertEquals("Check upf", upf, new Integer(1));
-//        assertEquals("Check upc", upc, new Integer(1));
-//        assertEquals("Check upbool", upbool, new Integer(1));
-        
-        reconfigureString();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        b = (byte[]) props.get("bs");
-        s = (short[]) props.get("ss");
-        i = (int[]) props.get("is");
-        l = (long[]) props.get("ls");
-        d = (double[]) props.get("ds");
-        f = (float[]) props.get("fs");
-        c = (char[]) props.get("cs");
-        bool = (boolean[]) props.get("bools");
-        
-        assertEquals("2) Check b 0", b[0], 3);
-        assertEquals("2) Check b 1", b[1], 2);
-        assertEquals("2) Check b 2", b[2], 1);
-        assertEquals("2) Check s 0", s[0], 3);
-        assertEquals("2) Check s 1", s[1], 2);
-        assertEquals("2) Check s 2", s[2], 1);
-        assertEquals("2) Check i 0", i[0], 3);
-        assertEquals("2) Check i 1", i[1], 2);
-        assertEquals("2) Check i 2", i[2], 1);
-        assertEquals("2) Check l 0", l[0], 3);
-        assertEquals("2) Check l 1", l[1], 2);
-        assertEquals("2) Check l 2", l[2], 1);
-        assertEquals("2) Check d 0", d[0], 3);
-        assertEquals("2) Check d 1", d[1], 2);
-        assertEquals("2) Check d 2", d[2], 1);
-        assertEquals("2) Check f 0", f[0], 3);
-        assertEquals("2) Check f 1", f[1], 2);
-        assertEquals("2) Check f 2", f[2], 1);
-        assertEquals("2) Check c 0", c[0], 'c');
-        assertEquals("2) Check c 1", c[1], 'b');
-        assertEquals("2) Check c 2", c[2], 'a');
-        assertFalse("2) Check bool 0", bool[0]);
-        assertFalse("2) Check bool 1", bool[0]);
-        assertFalse("2) Check bool 2", bool[0]);
-        
-//        upb = (Integer) props.get("upbs");
-//        ups = (Integer) props.get("upss");
-//        upi = (Integer) props.get("upis");
-//        upl = (Integer) props.get("upls");
-//        upd = (Integer) props.get("upds");
-//        upf = (Integer) props.get("upfs");
-//        upc = (Integer) props.get("upcs");
-//        upbool = (Integer) props.get("upbools");
-//        
-//        assertEquals("2) Check upb", upb, new Integer(2));
-//        assertEquals("2) Check ups", ups, new Integer(2));
-//        assertEquals("2) Check upi", upi, new Integer(2));
-//        assertEquals("2) Check upl", upl, new Integer(2));
-//        assertEquals("2) Check upd", upd, new Integer(2));
-//        assertEquals("2) Check upf", upf, new Integer(2));
-//        assertEquals("2) Check upc", upc, new Integer(2));
-//        assertEquals("2) Check upbool", upbool, new Integer(2));
-        
-    }
-    
-    public void testConfigurationObj() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigure();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-
-    public void testConfigurationObjString() {
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        CheckService check = (CheckService) getContext().getService(ref);
-        Properties props = check.getProps();
-        
-        String s = (String) props.get("string");
-        String[] ss = (String[]) props.get("strings");
-                
-        assertEquals("Check string", s, "foo");
-        assertEquals("Check strings 0", ss[0], "foo");
-        assertEquals("Check strings 1", ss[1], "bar");
-        assertEquals("Check strings 2", ss[2], "baz");
-        
-//        Integer upString = (Integer) props.get("upstring");
-//        Integer upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("Check upString", upString, new Integer(1));
-//        assertEquals("Check upStrings", upStrings, new Integer(1));
-        
-        reconfigureString();
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Test check service availability", ref);
-        check = (CheckService) getContext().getService(ref);
-        props = check.getProps();
-        
-        s = (String) props.get("string");
-        ss = (String[]) props.get("strings");
-                
-        assertEquals("2) Check string", s, "bar");
-        assertEquals("2) Check strings 0", ss[0], "baz");
-        assertEquals("2) Check strings 1", ss[1], "bar");
-        assertEquals("2) Check strings 2", ss[2], "foo");
-        
-//        upString = (Integer) props.get("upstring");
-//        upStrings = (Integer) props.get("upstrings");
-//        
-//        assertEquals("2) Check upString", upString, new Integer(2));
-//        assertEquals("2) Check upStrings", upStrings, new Integer(2));
-    }
-    
-    private void reconfigure() {
-        Properties props2 = new Properties();
-        props2.put("instance.name","under-test");
-        props2.put("b", new Byte("2"));
-        props2.put("s", new Short("2"));
-        props2.put("i", new Integer("2"));
-        props2.put("l", new Long("2"));
-        props2.put("d", new Double("2"));
-        props2.put("f", new Float("2"));
-        props2.put("c", new Character('b'));
-        props2.put("bool", new Boolean(false));
-        props2.put("bs", new byte[]{(byte)3,(byte)2,(byte)1});
-        props2.put("ss", new short[]{(short)3,(short)2,(short)1});
-        props2.put("is", new int[]{3,2,1});
-        props2.put("ls", new long[]{3,2,1});
-        props2.put("ds", new double[]{3,2,1});
-        props2.put("fs", new float[]{3,2,1});
-        props2.put("cs", new char[]{'c','b','a'});
-        props2.put("bools", new boolean[]{false,false,false});
-        props2.put("string", "bar");
-        props2.put("strings", new String[]{"baz", "bar", "foo"});
-        
-        instance.reconfigure(props2);
-    }
-    
-    private void reconfigureString() {
-        Properties props2 = new Properties();
-        props2.put("instance.name","under-test");
-        props2.put("b", "2");
-        props2.put("s", "2");
-        props2.put("i", "2");
-        props2.put("l", "2");
-        props2.put("d", "2");
-        props2.put("f", "2");
-        props2.put("c", "b");
-        props2.put("bool", "false");
-        props2.put("bs", "{3, 2,1}");
-        props2.put("ss", "{3, 2,1}");
-        props2.put("is", "{3, 2,1}");
-        props2.put("ls", "{3, 2,1}");
-        props2.put("ds", "{3, 2,1}");
-        props2.put("fs", "{3, 2,1}");
-        props2.put("cs", "{c, b , a}");
-        props2.put("bools", "{false,false,false}");
-        props2.put("string", "bar");
-        props2.put("strings", "{baz, bar, foo}");
-        
-        instance.reconfigure(props2);
-    }
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethod.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethod.java
deleted file mode 100644
index a204deb..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethod.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class UpdatedMethod extends OSGiTestCase {
-
-	ComponentInstance fooProvider1;
-	ComponentInstance fooProvider2;
-	ComponentInstance fooProvider3;
-
-	public void setUp() {
-		String type = "CONFIG-FooProviderType-ConfUpdated";
-
-		Properties p1 = new Properties();
-		p1.put("instance.name","FooProvider-1");
-		fooProvider1 = Utils.getComponentInstance(getContext(), type, p1);
-
-		Properties p2 = new Properties();
-		p2.put("instance.name","FooProvider-2");
-		p2.put("int", new Integer(4));
-		p2.put("boolean", new Boolean(false));
-		p2.put("string", new String("bar"));
-		p2.put("strAProp", new String[] {"bar", "foo"});
-		p2.put("intAProp", new int[] {1, 2, 3});
-		fooProvider2 = Utils.getComponentInstance(getContext(), type, p2);
-
-		Properties p3 = new Properties();
-        p3.put("instance.name","FooProvider-3");
-        fooProvider3 = Utils.getComponentInstance(getContext(), "CONFIG-FooProviderType-ConfNoValueUpdated", p3);
-	}
-
-	public void tearDown() {
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		fooProvider3.dispose();
-		fooProvider1 = null;
-		fooProvider2 = null;
-		fooProvider3 = null;
-	}
-
-	public void testComponentTypeConfiguration() {
-		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider1.getInstanceName());
-		assertNotNull("Check FooService availability", ref);
-		FooService fs = (FooService) getContext().getService(ref);
-		Properties toCheck = fs.fooProps();
-
-		Integer intProp = (Integer) toCheck.get("intProp");
-		Boolean boolProp = (Boolean) toCheck.get("boolProp");
-		String strProp = (String) toCheck.get("strProp");
-		String[] strAProp = (String[]) toCheck.get("strAProp");
-		int[] intAProp = (int[]) toCheck.get("intAProp");
-
-		// Check updated
-		Integer updated = (Integer) toCheck.get("updated");
-		Dictionary dict = (Dictionary) toCheck.get("lastupdated");
-
-		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
-		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity (1)", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1) : " + strAProp[i] + " != " + v[i]); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1) : " + intAProp[i] + " != " + v2[i]); }
-		}
-
-		assertEquals("updated count ", 1, updated.intValue());
-		assertEquals("Last updated", 5, dict.size());
-
-		// change the field value
-		assertTrue("Invoke the fs service", fs.foo());
-		toCheck = fs.fooProps();
-
-
-		//	Re-check the property (change)
-		intProp = (Integer) toCheck.get("intProp");
-		boolProp = (Boolean) toCheck.get("boolProp");
-		strProp = (String) toCheck.get("strProp");
-		strAProp = (String[]) toCheck.get("strAProp");
-		intAProp = (int[]) toCheck.get("intAProp");
-
-		// Check updated
-        updated = (Integer) toCheck.get("updated");
-        dict = (Dictionary) toCheck.get("lastupdated");
-
-		assertEquals("Check intProp equality (2) ("+intProp+")", intProp, new Integer(3));
-		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity (2)", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
-		}
-		assertNotNull("Check intAProp not nullity (2)", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2) : " + intAProp[i] + " != " + v2[i]); }
-		}
-
-		// This does not reconfigure...
-        assertEquals("updated count -2 ", 1, updated.intValue());
-        assertEquals("Last update - 2", 5, dict.size());
-
-		fs = null;
-		getContext().ungetService(ref);
-	}
-
-	public void testNoValue() {
-        ServiceReference sr = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "FooProvider-3");
-        assertNotNull("Check the availability of the FS service", sr);
-
-        FooService fs = (FooService) getContext().getService(sr);
-        Properties toCheck = fs.fooProps();
-
-        // Check service properties
-        Integer intProp = (Integer) toCheck.get("intProp");
-        Boolean boolProp = (Boolean) toCheck.get("boolProp");
-        String strProp = (String) toCheck.get("strProp");
-        String[] strAProp = (String[]) toCheck.get("strAProp");
-        int[] intAProp = (int[]) toCheck.get("intAProp");
-
-        // Check updated
-        Integer updated = (Integer) toCheck.get("updated");
-        Dictionary dict = (Dictionary) toCheck.get("lastupdated");
-
-        assertEquals("Check intProp equality", intProp, new Integer(0));
-        assertEquals("Check longProp equality", boolProp, new Boolean(false));
-        assertEquals("Check strProp equality", strProp, null);
-        assertNull("Check strAProp nullity", strAProp);
-        assertNull("Check intAProp  nullity", intAProp);
-
-        assertEquals("updated count ", 1, updated.intValue());
-        assertEquals("Last update", 0, dict.size());
-
-        assertTrue("invoke fs", fs.foo());
-        toCheck = fs.fooProps();
-
-        // Re-check the property (change)
-        intProp = (Integer) toCheck.get("intProp");
-        boolProp = (Boolean) toCheck.get("boolProp");
-        strProp = (String) toCheck.get("strProp");
-        strAProp = (String[]) toCheck.get("strAProp");
-        intAProp = (int[]) toCheck.get("intAProp");
-
-        updated = (Integer) toCheck.get("updated");
-        dict = (Dictionary) toCheck.get("lastupdated");
-
-        assertEquals("Check intProp equality", intProp, new Integer(3));
-        assertEquals("Check longProp equality", boolProp, new Boolean(true));
-        assertEquals("Check strProp equality", strProp, new String("bar"));
-        assertNotNull("Check strAProp not nullity", strAProp);
-        String[] v = new String[] {"foo", "bar", "baz"};
-        for (int i = 0; i < strAProp.length; i++) {
-            if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-        }
-        assertNotNull("Check intAProp not nullity", intAProp);
-        int[] v2 = new int[] {3, 2, 1};
-        for (int i = 0; i < intAProp.length; i++) {
-            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-        }
-
-        fs = null;
-        getContext().ungetService(sr);
-    }
-
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedService.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedService.java
deleted file mode 100644
index 0c78e26..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedService.java
+++ /dev/null
@@ -1,323 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
-
-public class UpdatedMethodAndManagedService extends OSGiTestCase {
-
-	/**
-	 * Instance where the ManagedServicePID is provided by the component type.
-	 */
-	ComponentInstance instance1;
-	/**
-     * Instance where the ManagedServicePID is provided by the instance.
-     */
-	ComponentInstance instance2;
-
-	/**
-     * Instance without configuration.
-     */
-    ComponentInstance instance3;
-
-	public void setUp() {
-	    String type = "CONFIG-FooProviderType-4Updated";
-        Properties p = new Properties();
-        p.put("instance.name","instance");
-        p.put("foo", "foo");
-        p.put("bar", "2");
-        p.put("baz", "baz");
-        instance1 = Utils.getComponentInstance(getContext(), type, p);
-        assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
-
-		type = "CONFIG-FooProviderType-3Updated";
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance-2");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		p1.put("managed.service.pid", "instance");
-		instance2 = Utils.getComponentInstance(getContext(), type, p1);
-
-		type = "CONFIG-FooProviderType-3Updated";
-        Properties p2 = new Properties();
-        p2.put("instance.name","instance-3");
-        p2.put("managed.service.pid", "instance-3");
-        instance3 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-	}
-
-	public void testStaticInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedService ms = (ManagedService) getContext().getService(msRef);
-		try {
-			ms.updated(conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Re-check props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-
-		// Get Service
-		FooService fs = (FooService) context.getService(fooRef);
-		Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        context.ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-
-	public void testStaticInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, "foo");
-        assertEquals("Check bar equality -1", barP, new Integer(2));
-        assertEquals("Check baz equality -1", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedService availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-
-        // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-        dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamicInstance1() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-
-    	ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedService ms = (ManagedService) getContext().getService(msRef);
-    	try {
-    		ms.updated(conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-    	// Re-check props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated -1", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-        dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-
-    }
-
-	public void testDynamicInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-        dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedServiceFactory.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedServiceFactory.java
deleted file mode 100644
index f9289c7..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedMethodAndManagedServiceFactory.java
+++ /dev/null
@@ -1,314 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class UpdatedMethodAndManagedServiceFactory extends OSGiTestCase {
-
-	ComponentInstance instance, instance2;
-
-	public void setUp() {
-		String type = "CONFIG-FooProviderType-3Updated";
-
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		instance = Utils.getComponentInstance(getContext(), type, p1);
-
-		Properties p2 = new Properties();
-        p2.put("instance.name","instance2");
-
-        instance2 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-
-	public void tearDown() {
-		instance.dispose();
-		instance2.dispose();
-		instance2 = null;
-		instance = null;
-	}
-
-	public void testStatic() {
-
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-
-		 // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        System.out.println("Dictionary : " + dict);
-        assertEquals("Check last updated", 3, dict.size()); // foo bar and baz as a service prooperties.
-
-		getContext().ungetService(msRef);
-
-	}
-
-	public void testStaticNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-
-        // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamic() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-
-    	ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-    	try {
-    		ms.updated(instance.getInstanceName(), conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-    	// Recheck props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-    }
-
-	public void testDynamicNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-
-    public void testDynamicString() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "oof");
-		conf.put("bar", "0");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality", fooP, "oof");
-		assertEquals("Check bar equality", barP, new Integer(0));
-		assertEquals("Check baz equality", bazP, "zab");
-
-		// Check field value
-		FooService fs = (FooService) getContext().getService(fooRef);
-		Properties p = fs.fooProps();
-		fooP = (String) p.get("foo");
-		barP = (Integer) p.get("bar");
-
-		assertEquals("Check foo field equality", fooP, "oof");
-		assertEquals("Check bar field equality", barP, new Integer(0));
-
-		Integer updated = (Integer) fs.fooProps().get("updated");
-        Dictionary dict = (Dictionary) fs.fooProps().get("lastupdated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-        assertEquals("Check last updated", 3, dict.size());
-
-
-		getContext().ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java
deleted file mode 100644
index c44236b..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedService.java
+++ /dev/null
@@ -1,307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedService;
-
-public class UpdatedNoArgMethodAndManagedService extends OSGiTestCase {
-
-	/**
-	 * Instance where the ManagedServicePID is provided by the component type.
-	 */
-	ComponentInstance instance1;
-	/**
-     * Instance where the ManagedServicePID is provided by the instance.
-     */
-	ComponentInstance instance2;
-
-	/**
-     * Instance without configuration.
-     */
-    ComponentInstance instance3;
-
-	public void setUp() {
-	    String type = "CONFIG-FooProviderType-4Updated2";
-        Properties p = new Properties();
-        p.put("instance.name","instance");
-        p.put("foo", "foo");
-        p.put("bar", "2");
-        p.put("baz", "baz");
-        instance1 = Utils.getComponentInstance(getContext(), type, p);
-        assertEquals("instance1 created", ComponentInstance.VALID,instance1.getState());
-
-		type = "CONFIG-FooProviderType-3Updated2";
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance-2");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		p1.put("managed.service.pid", "instance");
-		instance2 = Utils.getComponentInstance(getContext(), type, p1);
-
-		type = "CONFIG-FooProviderType-3Updated2";
-        Properties p2 = new Properties();
-        p2.put("instance.name","instance-3");
-        p2.put("managed.service.pid", "instance-3");
-        instance3 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-	}
-
-	public void testStaticInstance1() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedService ms = (ManagedService) getContext().getService(msRef);
-		try {
-			ms.updated(conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Re-check props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-
-		// Get Service
-		FooService fs = (FooService) context.getService(fooRef);
-		Integer updated = (Integer) fs.fooProps().get("updated");
-        assertEquals("Check updated", 1, updated.intValue());
-
-        context.ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-
-	public void testStaticInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, "foo");
-        assertEquals("Check bar equality -1", barP, new Integer(2));
-        assertEquals("Check baz equality -1", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedService availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-
-        // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamicInstance1() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-
-    	ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedService ms = (ManagedService) getContext().getService(msRef);
-    	try {
-    		ms.updated(conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-    	// Re-check props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance1.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated -1", 1, updated.intValue());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-
-
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-
-    }
-
-	public void testDynamicInstance2() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        String fooP = (String) fooRef.getProperty("foo");
-        Integer barP = (Integer) fooRef.getProperty("bar");
-        String bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "foo");
-        assertEquals("Check bar equality", barP, new Integer(2));
-        assertEquals("Check baz equality", bazP, "baz");
-
-        ServiceReference msRef = Utils.getServiceReferenceByPID(getContext(), ManagedService.class.getName(), "instance");
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedService ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-        conf.put("baz", "zab2");
-        conf.put("foo", "oof2");
-        conf.put("bar", new Integer(0));
-        ms = (ManagedService) getContext().getService(msRef);
-        try {
-            ms.updated(conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated -2", 2, updated.intValue());
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java
deleted file mode 100644
index 5067b93..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/UpdatedNoArgMethodAndManagedServiceFactory.java
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.configuration.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class UpdatedNoArgMethodAndManagedServiceFactory extends OSGiTestCase {
-
-	ComponentInstance instance, instance2;
-
-	public void setUp() {
-		String type = "CONFIG-FooProviderType-3Updated2";
-
-		Properties p1 = new Properties();
-		p1.put("instance.name","instance");
-		p1.put("foo", "foo");
-		p1.put("bar", "2");
-		p1.put("baz", "baz");
-		instance = Utils.getComponentInstance(getContext(), type, p1);
-
-		Properties p2 = new Properties();
-        p2.put("instance.name","instance2");
-
-        instance2 = Utils.getComponentInstance(getContext(), type, p2);
-	}
-
-	public void tearDown() {
-		instance.dispose();
-		instance2.dispose();
-		instance2 = null;
-		instance = null;
-	}
-
-	public void testStatic() {
-
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -1", fooP, "foo");
-		assertEquals("Check bar equality -1", barP, new Integer(2));
-		assertEquals("Check baz equality -1", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("bar", new Integer(2));
-		conf.put("foo", "foo");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-		assertEquals("Check foo equality -2", fooP, "foo");
-		assertEquals("Check bar equality -2", barP, new Integer(2));
-		assertEquals("Check baz equality -2", bazP, "zab");
-
-		 // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-		getContext().ungetService(msRef);
-
-	}
-
-	public void testStaticNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("bar", new Integer(2));
-        conf.put("foo", "foo");
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-        assertEquals("Check foo equality -2", fooP, "foo");
-        assertEquals("Check bar equality -2", barP, new Integer(2));
-        assertEquals("Check baz equality -2", bazP, "zab");
-
-        // Get Service
-        FooService fs = (FooService) context.getService(fooRef);
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-        getContext().ungetService(msRef);
-    }
-
-	public void testDynamic() {
-    	ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	assertNotNull("Check FS availability", fooRef);
-
-    	String fooP = (String) fooRef.getProperty("foo");
-    	Integer barP = (Integer) fooRef.getProperty("bar");
-    	String bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "foo");
-    	assertEquals("Check bar equality", barP, new Integer(2));
-    	assertEquals("Check baz equality", bazP, "baz");
-
-    	ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-    	assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-    	// Configuration of baz
-    	Properties conf = new Properties();
-    	conf.put("baz", "zab");
-    	conf.put("foo", "oof");
-    	conf.put("bar", new Integer(0));
-    	ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-    	try {
-    		ms.updated(instance.getInstanceName(), conf);
-    	} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-    	// Recheck props
-    	fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-    	fooP = (String) fooRef.getProperty("foo");
-    	barP = (Integer) fooRef.getProperty("bar");
-    	bazP = (String) fooRef.getProperty("baz");
-
-    	assertEquals("Check foo equality", fooP, "oof");
-    	assertEquals("Check bar equality", barP, new Integer(0));
-    	assertEquals("Check baz equality", bazP, "zab");
-
-    	// Check field value
-    	FooService fs = (FooService) getContext().getService(fooRef);
-    	Properties p = fs.fooProps();
-    	fooP = (String) p.get("foo");
-    	barP = (Integer) p.get("bar");
-
-    	assertEquals("Check foo field equality", fooP, "oof");
-    	assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-    	getContext().ungetService(fooRef);
-    	getContext().ungetService(msRef);
-    }
-
-	public void testDynamicNoValue() {
-        ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check FS availability", fooRef);
-
-        Object fooP = fooRef.getProperty("foo");
-        Object barP = fooRef.getProperty("bar");
-        Object bazP = fooRef.getProperty("baz");
-        assertEquals("Check foo equality -1", fooP, null);
-        assertEquals("Check bar equality -1", barP, null);
-        assertEquals("Check baz equality -1", bazP, null);
-
-        ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance2.getFactory().getName());
-        assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-        // Configuration of baz
-        Properties conf = new Properties();
-        conf.put("baz", "zab");
-        conf.put("foo", "oof");
-        conf.put("bar", new Integer(0));
-        ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-        try {
-            ms.updated(instance2.getInstanceName(), conf);
-        } catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-        // Recheck props
-        fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance2.getInstanceName());
-        fooP = (String) fooRef.getProperty("foo");
-        barP = (Integer) fooRef.getProperty("bar");
-        bazP = (String) fooRef.getProperty("baz");
-
-        assertEquals("Check foo equality", fooP, "oof");
-        assertEquals("Check bar equality", barP, new Integer(0));
-        assertEquals("Check baz equality", bazP, "zab");
-
-        // Check field value
-        FooService fs = (FooService) getContext().getService(fooRef);
-        Properties p = fs.fooProps();
-        fooP = (String) p.get("foo");
-        barP = (Integer) p.get("bar");
-
-        assertEquals("Check foo field equality", fooP, "oof");
-        assertEquals("Check bar field equality", barP, new Integer(0));
-
-        Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-        getContext().ungetService(fooRef);
-        getContext().ungetService(msRef);
-    }
-
-
-    public void testDynamicString() {
-		ServiceReference fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check FS availability", fooRef);
-
-		String fooP = (String) fooRef.getProperty("foo");
-		Integer barP = (Integer) fooRef.getProperty("bar");
-		String bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality", fooP, "foo");
-		assertEquals("Check bar equality", barP, new Integer(2));
-		assertEquals("Check baz equality", bazP, "baz");
-
-		ServiceReference msRef = Utils.getServiceReferenceByName(getContext(), ManagedServiceFactory.class.getName(), instance.getFactory().getName());
-		assertNotNull("Check ManagedServiceFactory availability", msRef);
-
-		// Configuration of baz
-		Properties conf = new Properties();
-		conf.put("baz", "zab");
-		conf.put("foo", "oof");
-		conf.put("bar", "0");
-		ManagedServiceFactory ms = (ManagedServiceFactory) getContext().getService(msRef);
-		try {
-			ms.updated(instance.getInstanceName(), conf);
-		} catch (ConfigurationException e) { fail("Configuration Exception : " + e); }
-
-		// Recheck props
-		fooRef = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), instance.getInstanceName());
-		fooP = (String) fooRef.getProperty("foo");
-		barP = (Integer) fooRef.getProperty("bar");
-		bazP = (String) fooRef.getProperty("baz");
-
-		assertEquals("Check foo equality", fooP, "oof");
-		assertEquals("Check bar equality", barP, new Integer(0));
-		assertEquals("Check baz equality", bazP, "zab");
-
-		// Check field value
-		FooService fs = (FooService) getContext().getService(fooRef);
-		Properties p = fs.fooProps();
-		fooP = (String) p.get("foo");
-		barP = (Integer) p.get("bar");
-
-		assertEquals("Check foo field equality", fooP, "oof");
-		assertEquals("Check bar field equality", barP, new Integer(0));
-
-		Integer updated = (Integer) fs.fooProps().get("updated");
-
-        assertEquals("Check updated", 1, updated.intValue());
-
-		getContext().ungetService(fooRef);
-		getContext().ungetService(msRef);
-	}
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java
deleted file mode 100644
index e8f89b9..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java
deleted file mode 100644
index 7f6a005..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/configuration/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.configuration.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index ca53df4..0000000
--- a/ipojo/tests/core/configuration/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-//import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-          
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/external-handlers/pom.xml b/ipojo/tests/core/external-handlers/pom.xml
deleted file mode 100644
index 1031e23..0000000
--- a/ipojo/tests/core/external-handlers/pom.xml
+++ /dev/null
@@ -1,124 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO External Handler Mechanism Test Suite</name>
-  <artifactId>tests.core.external.handlers</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.eh.service
-              </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-              </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-              </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.eh.ExternalHandlerTestSuite
-              </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
deleted file mode 100644
index 7bdcfb0..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandler.java
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.PrimitiveHandler;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.architecture.PropertyDescription;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.eh.service.CheckService;
-import org.osgi.framework.ServiceRegistration;
-
-public class CheckServiceHandler extends PrimitiveHandler implements CheckService {
-
-	ServiceRegistration sr;
-	boolean isValid;
-	int changes = 0;
-	static final String NAMESPACE = "org.apache.felix.ipojo.test.handler.checkservice";
-
-	Properties props = new Properties();
-
-	public void configure(Element metadata, Dictionary configuration) {
-		Element[] meta = metadata.getElements("check", NAMESPACE);
-		if(meta == null) { return;	}
-		// Get handler props
-		props.put("instance.name", configuration.get("instance.name"));
-		if(configuration.get("csh.simple") != null) { props.put("Simple", configuration.get("csh.simple")); }
-		if(configuration.get("csh.map") != null) {
-			Dictionary m = (Dictionary) configuration.get("csh.map");
-            if (m.size() > 0) {
-                props.put("Map1", m.get("a"));
-                props.put("Map2", m.get("b"));
-                props.put("Map3", m.get("c"));
-            }
-		}
-		props.put("changes", new Integer(changes));
-
-	}
-
-	public void initializeComponentFactory(ComponentTypeDescription cd, Element metadata) {
-	    cd.addProperty(new PropertyDescription("csh.simple", "java.lang.String", null));
-        cd.addProperty(new PropertyDescription("csh.map", "java.util.Dictionary", null));
-	}
-
-	public void start() {
-		if(sr == null) {
-			sr = getInstanceManager().getContext().registerService(CheckService.class.getName(), this, props);
-		}
-		isValid = true;
-	}
-
-	public void stop() {
-		isValid = false;
-		synchronized(this) {
-			if(sr != null) { sr.unregister(); }
-		}
-	}
-
-	public boolean check() {
-		if(isValid) { isValid = false;}
-		else { isValid = true; }
-		return isValid;
-	}
-
-	public Properties getProps() {
-		return props;
-	}
-
-	public void stateChanged(int state) {
-		if (sr != null) {
-		    changes++;
-		    props.put("changes", new Integer(changes));
-		    sr.setProperties(props);
-		}
-	}
-
-	public String getName() {
-		return NAMESPACE;
-	}
-
-	public HandlerDescription getDescription() {
-		return new CheckServiceHandlerDescription(this);
-	}
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java
deleted file mode 100644
index ade2474..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceHandlerDescription.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-
-public class CheckServiceHandlerDescription extends HandlerDescription {
-
-	public CheckServiceHandlerDescription(Handler h) {
-		super(h);
-	}
-	
-	public Element getHandlerInfo() {
-		Element elem = super.getHandlerInfo();
-		elem.addAttribute(new Attribute("isValid", isValid()+""));
-		return elem;
-	}
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index b82cf3c..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.eh.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/AutoHandlerTest.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/AutoHandlerTest.java
deleted file mode 100644
index 4445cb8..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/AutoHandlerTest.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.eh;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.component.CheckServiceHandlerDescription;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-
-public class AutoHandlerTest extends OSGiTestCase {
-
-	private static final String ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE = "org.apache.felix.ipojo.handler.auto.primitive";
-
-	ComponentInstance instance;
-
-	ComponentFactory factory;
-
-	public void setUp() {
-		factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "HANDLER-HandlerTesterWO");
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
-	}
-
-	public void tearDown() {
-		if (instance != null) {
-			instance.dispose();
-		}
-		instance = null;
-
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
-
-	}
-
-	public void testRequiredHandlerList() {
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
-
-		factory.stop();
-		factory.restart();
-		factory.start();
-
-		List list = factory.getRequiredHandlers();
-		assertFalse(list.contains("org.apache.felix.ipojo.test.handler.checkservice:check"));
-
-		String v = "org.apache.felix.ipojo.test.handler.checkservice:check";
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, v);
-
-		factory.stop();
-		factory.restart();
-		factory.start();
-
-		list = factory.getRequiredHandlers();
-		assertTrue(list.contains("org.apache.felix.ipojo.test.handler.checkservice:check"));
-
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
-
-	}
-
-	public void testInstanceCreation() throws Exception {
-		String v = "org.apache.felix.ipojo.test.handler.checkservice:check";
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, v);
-
-		factory.stop();
-		factory.restart();
-		factory.start();
-
-		instance = factory.createComponentInstance(new Properties());
-		assertEquals(ComponentInstance.VALID, instance.getState());
-
-		HandlerDescription hd = instance.getInstanceDescription().getHandlerDescription(v);
-		assertNotNull(hd);
-		assertTrue(hd instanceof CheckServiceHandlerDescription);
-
-		System.setProperty(ORG_APACHE_FELIX_IPOJO_HANDLER_AUTO_PRIMITIVE, "");
-
-		factory.stop();
-		factory.restart();
-		factory.start();
-	}
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java
deleted file mode 100644
index 4f66028..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/ExternalHandlerTestSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.eh;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ExternalHandlerTestSuite extends TestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("External Handler Test Suite", bc);
-		ots.addTestSuite(HandlerTest.class);
-		ots.addTestSuite(AutoHandlerTest.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
deleted file mode 100644
index 1e89772..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/HandlerTest.java
+++ /dev/null
@@ -1,213 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.eh;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.eh.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-public class HandlerTest extends OSGiTestCase {
-
-	ComponentInstance instance;
-
-	public void setUp() {
-		Properties props = new Properties();
-		props.put("instance.name","HandlerTest-1");
-		props.put("csh.simple", "simple");
-		Properties p = new Properties();
-		p.put("a", "a");
-		p.put("b", "b");
-		p.put("c", "c");
-		props.put("csh.map", p);
-		instance = Utils.getComponentInstance(getContext(), "HANDLER-HandlerTester", props);
-	}
-	
-	public void tearDown() {
-		instance.dispose();
-		instance = null;
-	}
-	
-	public void testConfiguration1() {
-		// Check the availability of CheckService
-	    String name = "HandlerTest-1";
-		ServiceReference sr = null;
-		ServiceReference[] refs = null;
-        String filter = "("+"instance.name"+"="+name+")";
-        try {
-            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
-        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
-        if(refs != null) { sr = refs[0]; }
-        
-		assertNotNull("Check the check service availability", sr);
-		
-		CheckService cs = (CheckService) getContext().getService(sr);
-		Properties p = cs.getProps();
-		assertEquals("Assert 'simple' equality", p.get("Simple"), "simple");
-		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
-		assertEquals("Assert 'b' equality", p.get("Map2"), "b");
-		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
-		
-		cs = null;
-		getContext().ungetService(sr);
-	}
-	
-	public void testConfiguration2() {
-		// Check the availability of CheckService
-	    String name = "HandlerTest-2";
-        ServiceReference sr = null;
-        ServiceReference[] refs = null;
-        String filter = "("+"instance.name"+"="+name+")";
-        try {
-            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
-        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
-        if(refs != null) { sr = refs[0]; }
-		assertNotNull("Check the check service availability", sr);
-		
-		CheckService cs = (CheckService) getContext().getService(sr);
-		Properties p = cs.getProps();
-		assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
-		assertEquals("Assert 'a' equality", p.get("Map1"), "a");
-		assertEquals("Assert 'b' equality", p.get("Map2"), "b");
-		assertEquals("Assert 'c' equality", p.get("Map3"), "c");
-		
-		cs = null;
-		getContext().ungetService(sr);
-	}
-	
-
-    public void testConfiguration3() {
-        // Check the availability of CheckService
-        String name = "HandlerTest-2-empty";
-        ServiceReference sr = null;
-        ServiceReference[] refs = null;
-        String filter = "("+"instance.name"+"="+name+")";
-        try {
-            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
-        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
-        if(refs != null) { sr = refs[0]; }
-        assertNotNull("Check the check service availability", sr);
-        
-        CheckService cs = (CheckService) getContext().getService(sr);
-        Properties p = cs.getProps();
-        assertEquals("Assert 'simple' equality", p.get("Simple"), "Simple");
-        assertEquals("Size of p", 3, p.size()); // instance name, simple and changes.
-        
-        cs = null;
-        getContext().ungetService(sr);
-    }
-	
-	public void testLifecycle() {
-		// Check the availability of CheckService
-	    String name = "HandlerTest-1";
-        ServiceReference sr = null;
-        ServiceReference[] refs = null;
-        String filter = "("+"instance.name"+"="+name+")";
-        try {
-            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
-        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
-        if(refs != null) { sr = refs[0]; }
-		assertNotNull("Check the check service availability", sr);
-		
-		ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
-		Architecture arch = (Architecture) getContext().getService(sr_arch);
-		
-		assertEquals("Check instance validity - 0", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
-		
-		CheckService cs = (CheckService) getContext().getService(sr);
-		Properties p = cs.getProps();
-		Integer changes = (Integer) p.get("changes");
-		assertNotNull("Check changes no null", changes);
-		assertEquals("Changes changes 1 ("+changes+")", changes.intValue(), 1);
-		assertEquals("Check instance validity - 1", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
-		cs.check();
-		p = cs.getProps();
-		changes = (Integer) p.get("changes");
-		assertEquals("Changes changes 2 ("+changes+")", changes.intValue(), 2);
-		assertEquals("Check instance validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
-		cs.check();
-		p = cs.getProps();
-		changes = (Integer) p.get("changes");
-		assertEquals("Changes changes 3 ("+changes+")", changes.intValue(), 3);
-		assertEquals("Check instance validity - 3", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
-		cs.check();
-		p = cs.getProps();
-		changes = (Integer) p.get("changes");
-		assertEquals("Changes changes 4 ("+changes+")", changes.intValue(), 4);
-		assertEquals("Check instance validity - 4", arch.getInstanceDescription().getState(), ComponentInstance.INVALID);
-		
-		cs = null;
-		arch = null;
-		getContext().ungetService(sr_arch);
-		getContext().ungetService(sr);
-	}
-	
-	public void testAvailability() {
-	    String name = "HandlerTest-1";
-        ServiceReference sr = null;
-        ServiceReference[] refs = null;
-        String filter = "("+"instance.name"+"="+name+")";
-        try {
-            refs = getContext().getServiceReferences(CheckService.class.getName(), filter);
-        } catch (InvalidSyntaxException e) { System.err.println("Invalid Filter : " + filter);}
-        if(refs != null) { sr = refs[0]; }
-        assertNotNull("Check the check service availability", sr);
-        
-        ServiceReference sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
-        Architecture arch = (Architecture) getContext().getService(sr_arch);
-        assertEquals("Check validity", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
-        
-        // Kill the handler factory
-        HandlerManagerFactory f = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "check");
-        f.stop();
-        
-        sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
-        assertNull("Check the check service unavailability", sr);
-        
-        sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
-        assertNull("Check the architecture unavailability", sr_arch);
-        
-        // The instance is disposed, restart the handler
-        f.start();
-        
-        Properties props = new Properties();
-        props.put("instance.name","HandlerTest-1");
-        props.put("csh.simple", "simple");
-        Properties p = new Properties();
-        p.put("a", "a");
-        p.put("b", "b");
-        p.put("c", "c");
-        props.put("csh.map", p);
-        instance = Utils.getComponentInstance(getContext(), "HANDLER-HandlerTester", props);
-        
-        sr = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "HandlerTest-1");
-        assertNotNull("Check the check service availability - 2", sr);
-        
-        sr_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "HandlerTest-1");
-        arch = (Architecture) getContext().getService(sr_arch);
-        assertEquals("Check validity - 2", arch.getInstanceDescription().getState(), ComponentInstance.VALID);
-	}
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java
deleted file mode 100644
index 9239759..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.eh.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java
deleted file mode 100644
index 38d66ff..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/eh/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.eh.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 0e2375f..0000000
--- a/ipojo/tests/core/external-handlers/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(HandlerFactory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/external-handlers/src/main/resources/metadata.xml b/ipojo/tests/core/external-handlers/src/main/resources/metadata.xml
deleted file mode 100644
index b7da090..0000000
--- a/ipojo/tests/core/external-handlers/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
-	xmlns:cs="org.apache.felix.ipojo.test.handler.checkservice">
-	<handler
-		classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceHandler"
-		name="check"
-		namespace="org.apache.felix.ipojo.test.handler.checkservice"
-		architecture="false">
-		<controller field="isValid" />
-	</handler>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="HANDLER-HandlerTester" architecture="true">
-		<cs:check />
-	</component>
-	<instance name="HandlerTest-2" component="HANDLER-HandlerTester">
-		<property name="csh.simple" value="Simple" />
-		<property name="csh.map">
-			<property name="a" value="a" />
-			<property name="b" value="b" />
-			<property name="c" value="c" />
-		</property>
-	</instance>
-	<instance name="HandlerTest-2-empty" component="HANDLER-HandlerTester">
-		<property name="csh.simple" value="Simple" />
-		<property name="csh.map">
-		<!-- Empty dictionary -->
-		</property>
-	</instance>
-
-	<!-- The handler will be added using the auto handler property -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="HANDLER-HandlerTesterWO" architecture="true">
-	</component>
-
-</ipojo>
diff --git a/ipojo/tests/core/factories/pom.xml b/ipojo/tests/core/factories/pom.xml
deleted file mode 100644
index a648383..0000000
--- a/ipojo/tests/core/factories/pom.xml
+++ /dev/null
@@ -1,134 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Factories Test Suite</name>
-  <artifactId>tests.core.factories</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.configadmin</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.factories.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.factories.FactoryTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-                <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
deleted file mode 100644
index 7f7f37d..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index fdaf7c1..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
deleted file mode 100644
index 419da2e..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-
-public class FooBarProviderType1 implements FooService, BarService {
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		return new Properties();
-	}
-
-	public boolean bar() {
-		return true;
-	}
-
-	public Properties getProps() {
-		return new Properties();
-	}
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 46593da..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
deleted file mode 100644
index 77a1583..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-
-
-public class FooProviderTypeDyn implements FooService {
-	
-	private int intProp;	
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-
-	public boolean foo() {
-		intProp = 3;
-		boolProp = true;
-		if(strProp.equals("foo")) { strProp = "bar"; }
-		else { strProp = "foo"; }
-		strAProp = new String[] {"foo", "bar", "baz"};
-		intAProp = new int[] {3, 2, 1};
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
deleted file mode 100644
index 8cc7d12..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-
-public class FooProviderTypeDyn2 implements FooService {
-	
-	private int intProp = 2;
-	private boolean boolProp = true;
-	private String strProp = "foo";
-	private String[] strAProp = new String[] {"foo", "bar"};
-	private int[] intAProp = new int[] {1, 2, 3};
-
-	public boolean foo() {
-		intAProp = null;
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ReconfigurableSimpleType.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ReconfigurableSimpleType.java
deleted file mode 100644
index b84c40f..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ReconfigurableSimpleType.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ReconfigurableSimpleType {
-
-
-	private String prop; // Property.
-
-	private String x; // Property.
-
-	boolean controller;
-
-	public void start () {
-		if (prop == null || prop.equals("KO")) {
-			throw new IllegalStateException("Bad Configuration : " + prop);
-		}
-
-		if (x == null) {
-			throw new IllegalStateException("x is null");
-		}
-
-		System.out.println("OK !!!!");
-	}
-
-	public void setX(String v) {
-		x = v;
-	}
-
-	public void setProp(String p) {
-		prop = p;
-		if (prop == null || prop.equals("KO")) {
-			controller = false;
-		} else {
-			controller = true;
-			System.out.println("OK !!!!");
-		}
-	}
-
-	public void setController(boolean p) {
-		if (p) {
-			System.out.println("OK !!!!");
-		}
-	}
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleType.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleType.java
deleted file mode 100644
index 6938eba..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleType.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class SimpleType {
-    
-    private boolean m_controller;
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
deleted file mode 100644
index 81bbc9e..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ComponentDesc.java
+++ /dev/null
@@ -1,371 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.architecture.PropertyDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Check component type description.
- */
-public class ComponentDesc extends OSGiTestCase {
-	
-	ServiceReference sr_fooProvider1;
-	ServiceReference sr_fooProvider2;
-	ServiceReference sr_fooProviderDyn2;
-	ServiceReference sr_fooProvider3;
-	ServiceReference sr_foobarProvider;
-//	ServiceReference sr_simple;
-//	ServiceReference sr_optional;
-//	ServiceReference sr_multiple;
-//	ServiceReference sr_multiple_optional;
-	
-	Factory fooProvider1;
-	Factory fooProvider2;
-	Factory fooProviderDyn2;
-	Factory fooProvider3;
-	Factory foobarProvider;
-//	Factory simple;
-//	Factory optional;
-//	Factory multiple;
-//	Factory multiple_optional;
-	
-	public void setUp() {
-		sr_fooProvider1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-1");
-		sr_fooProvider2 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-2");
-		sr_fooProviderDyn2 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-Dyn2");
-		sr_fooProvider3 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-3");
-		sr_foobarProvider = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooBarProviderType-1");
-//		sr_simple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleCheckServiceProvider");
-//		sr_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalCheckServiceProvider");
-//		sr_multiple = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleMultipleCheckServiceProvider");
-//		sr_multiple_optional = Utils.getServiceReferenceByName(context, Factory.class.getName(), "SimpleOptionalMultipleCheckServiceProvider");
-		
-		fooProvider1 = (Factory) getContext().getService(sr_fooProvider1);
-		fooProvider2 = (Factory) getContext().getService(sr_fooProvider2);
-		fooProviderDyn2 = (Factory) getContext().getService(sr_fooProviderDyn2);
-		fooProvider3 = (Factory) getContext().getService(sr_fooProvider3);
-		foobarProvider = (Factory) getContext().getService(sr_foobarProvider);
-//		simple = (Factory) context.getService(sr_simple);
-//		optional = (Factory) context.getService(sr_optional);
-//		multiple = (Factory) context.getService(sr_multiple);
-//		multiple_optional = (Factory) context.getService(sr_multiple_optional);
-		
-	}
-	
-	public void tearDown() {
-		fooProvider1 = null;
-		fooProvider2 = null;
-		fooProviderDyn2 = null;
-		fooProvider3 = null;
-		foobarProvider = null;
-//		simple = null;
-//		multiple = null;
-//		optional = null;
-//		multiple_optional = null;
-		
-		getContext().ungetService(sr_fooProvider1);
-		getContext().ungetService(sr_fooProvider2);
-		getContext().ungetService(sr_fooProviderDyn2);
-		getContext().ungetService(sr_fooProvider3);
-		getContext().ungetService(sr_foobarProvider);
-//		context.ungetService(sr_simple);
-//		context.ungetService(sr_optional);
-//		context.ungetService(sr_multiple);
-//		context.ungetService(sr_multiple_optional);
-	}
-	
-	/**
-	 * Check simple providing.
-	 */
-	public void testFooProvider1() {
-		// Test SR properties
-//		String impl = (String) sr_fooProvider1.getProperty("component.class");
-//		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-		
-		String[] specs = (String[]) sr_fooProvider1.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
-		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
-		
-		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider1.getProperty("component.properties");
-		assertEquals("Check component.properties length", pd.length, 0);
-		
-		// Test factory
-		assertEquals("Check factory name", fooProvider1.getName(), "Factories-FooProviderType-1");
-		Element cd = fooProvider1.getDescription();
-		
-//		assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
-		
-		Element[] specs2 = cd.getElements("provides");
-		assertEquals("Check specs length", specs2.length, 1);
-		assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
-		
-		Element[] pd2 = cd.getElements("property");
-		assertNull("Check props null", pd2);
-		
-		// Check Description equality
-		ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider1.getProperty("component.description");
-		assertNotNull("check description equality", desc);
-	}
-	
-	/**
-	 * Check component properties.
-	 */
-	public void testFooProvider2() {
-		// Test SR properties
-//		String impl = (String) sr_fooProvider2.getProperty("component.class");
-//		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-		
-		String[] specs = (String[]) sr_fooProvider2.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
-		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
-		
-		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider2.getProperty("component.properties");
-		assertEquals("Check component.properties length", pd.length, 5);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "int", pd[0].getName());
-		assertEquals("Check component.properties type [" + 0 + "]", "int", pd[0].getType());
-		assertEquals("Check component.properties value [" + 0 + "]", "2", pd[0].getValue());
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "long", pd[1].getName());
-		assertEquals("Check component.properties type [" + 1 + "]", "long", pd[1].getType());
-		assertEquals("Check component.properties value [" + 1 + "]", "40", pd[1].getValue());
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "string", pd[2].getName());
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
-		assertEquals("Check component.properties value [" + 2 + "]", "foo", pd[2].getValue());
-		
-		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd[3].getName());
-		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd[3].getType());
-		
-		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd[4].getName());
-		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
-		
-		// Test factory
-		assertEquals("Check factory name", fooProvider2.getName(), "Factories-FooProviderType-2");
-		Element cd = fooProvider2.getDescription();
-        
-//        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
-		
-        Element[] specs2 = cd.getElements("provides");
-        assertEquals("Check specs length", specs2.length, 1);
-        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
-		
-        Element[] pd2 = cd.getElements("property");
-		assertEquals("Check props length", pd2.length, 5);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "int", pd2[0].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 0 + "]", "int", pd2[0].getAttribute("type"));
-		assertEquals("Check component.properties value [" + 0 + "]", "2", pd2[0].getAttribute("value"));
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "long", pd2[1].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 1 + "]", "long", pd2[1].getAttribute("type"));
-		assertEquals("Check component.properties value [" + 1 + "]", "40", pd2[1].getAttribute("value"));
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "string", pd2[2].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
-		assertEquals("Check component.properties value [" + 2 + "]", "foo", pd2[2].getAttribute("value"));
-		
-		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd2[3].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd2[3].getAttribute("type"));
-		
-		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
-		
-		// Check Description equality
-		ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider2.getProperty("component.description");
-        assertNotNull("check description equality", desc);
-
-        // Check that we have the complete metadata
-        assertNotNull(fooProvider2.getComponentMetadata());
-	}
-	
-	/**
-	 * Check component properties (dynamic).
-	 */
-	public void testFooProviderDyn2() {
-		// Test SR properties
-//		String impl = (String) sr_fooProviderDyn2.getProperty("component.class");
-//		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2");
-		
-		String[] specs = (String[]) sr_fooProviderDyn2.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
-		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
-		
-		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProviderDyn2.getProperty("component.properties");
-		assertEquals("Check component.properties length", pd.length, 5);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "int", pd[0].getName());
-		assertEquals("Check component.properties type [" + 0 + "]", "int", pd[0].getType());
-		assertEquals("Check component.properties value [" + 0 + "]", "4", pd[0].getValue());
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "boolean", pd[1].getName());
-		assertEquals("Check component.properties type [" + 1 + "]", "boolean", pd[1].getType());
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "string", pd[2].getName());
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
-		
-		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd[3].getName());
-		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd[3].getType());
-		
-		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd[4].getName());
-		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd[4].getType());
-		
-		// Test factory
-		assertEquals("Check factory name", fooProviderDyn2.getName(), "Factories-FooProviderType-Dyn2");
-		Element cd = fooProviderDyn2.getDescription();
-		
-//        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
-        
-        Element[] specs2 = cd.getElements("provides");
-        assertEquals("Check specs length", specs2.length, 1);
-        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
-        
-        Element[] pd2 = cd.getElements("property");
-        assertEquals("Check props length", pd2.length, 5);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "int", pd2[0].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 0 + "]", "int", pd2[0].getAttribute("type"));
-		assertEquals("Check component.properties value [" + 0 + "]", "4", pd2[0].getAttribute("value"));
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "boolean", pd2[1].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 1 + "]", "boolean", pd2[1].getAttribute("type"));
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "string", pd2[2].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
-		
-		assertEquals("Check component.properties name [" + 3 + "]", "strAProp", pd2[3].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 3 + "]", "java.lang.String[]", pd2[3].getAttribute("type"));
-		
-		assertEquals("Check component.properties name [" + 4 + "]", "intAProp", pd2[4].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 4 + "]", "int[]", pd2[4].getAttribute("type"));
-		
-		// Check Description equality
-		ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProviderDyn2.getProperty("component.description");
-		assertNotNull("check description equality", desc);
-
-        // Check that we have the complete metadata
-        assertNotNull(fooProvider2.getComponentMetadata());
-	}
-	
-	/**
-	 * Check component properties.
-	 */
-	public void testFooProvider3() {
-		// Test SR properties
-//		String impl = (String) sr_fooProvider3.getProperty("component.class");
-//		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-		
-		String[] specs = (String[]) sr_fooProvider3.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check component.providedServiceSpecifications length", specs.length, 1);
-		assertEquals("Check component.providedServiceSpecifications", FooService.class.getName(), specs[0]);
-		
-		PropertyDescription[] pd = (PropertyDescription[]) sr_fooProvider3.getProperty("component.properties");
-		assertEquals("Check component.properties length (" + pd.length +")", pd.length, 3);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "foo", pd[0].getName());
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "bar", pd[1].getName());
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "baz", pd[2].getName());
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd[2].getType());
-		
-		// Test factory
-		assertEquals("Check factory name", fooProvider3.getName(), "Factories-FooProviderType-3");
-		Element cd = fooProvider3.getDescription();
-        
-//		assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
-        
-        Element[] specs2 = cd.getElements("provides");
-        assertEquals("Check specs length", specs2.length, 1);
-        assertEquals("Check specs", FooService.class.getName(), specs2[0].getAttribute("specification"));
-        
-        Element[] pd2 = cd.getElements("property");
-        assertEquals("Check props length", pd2.length, 3);
-		
-		assertEquals("Check component.properties name [" + 0 + "]", "foo", pd2[0].getAttribute("name"));
-		
-		assertEquals("Check component.properties name [" + 1 + "]", "bar", pd2[1].getAttribute("name"));
-		
-		assertEquals("Check component.properties name [" + 2 + "]", "baz", pd2[2].getAttribute("name"));
-		assertEquals("Check component.properties type [" + 2 + "]", "java.lang.String", pd2[2].getAttribute("type"));
-		
-		// Check Description equality
-		ComponentTypeDescription desc = (ComponentTypeDescription) sr_fooProvider3.getProperty("component.description");
-		assertNotNull("check description equality", desc);
-	}
-	
-	/**
-	 * Test two services provider.
-	 */
-	public void testFooBar() {
-		//	Test SR properties
-//		String impl = (String) sr_foobarProvider.getProperty("component.class");
-//		assertEquals("Check component.class", impl, "org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1");
-		
-		String[] specs = (String[]) sr_foobarProvider.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check component.providedServiceSpecifications length", specs.length, 2);
-		assertTrue("Check component.providedServiceSpecifications 1", Utils.contains(FooService.class.getName(), specs));
-		assertTrue("Check component.providedServiceSpecifications 2", Utils.contains(BarService.class.getName(), specs));
-		
-		PropertyDescription[] pd = (PropertyDescription[]) sr_foobarProvider.getProperty("component.properties");
-		assertEquals("Check component.properties length", pd.length, 0);
-		
-		// Test factory
-		assertEquals("Check factory name", foobarProvider.getName(), "Factories-FooBarProviderType-1");
-		Element cd = foobarProvider.getDescription();
-		
-//        assertEquals("Check implementation class ", cd.getAttribute("implementation-class"), impl);
-		
-        Element[] specs2 = cd.getElements("provides");
-        assertEquals("Check specs length", specs2.length, 2);
-        assertTrue("Check specs", containsSpecification(FooService.class.getName(), specs2));
-        assertTrue("Check specs", containsSpecification(BarService.class.getName(), specs2));
-        
-        Element[] pd2 = cd.getElements("property");
-        assertNull("Check props null", pd2);
-		
-		// Check Description equality
-        ComponentTypeDescription desc = (ComponentTypeDescription) sr_foobarProvider.getProperty("component.description");
-		assertNotNull("check description equality", desc);
-
-        // Check that we have the complete metadata
-        assertNotNull(foobarProvider.getComponentMetadata());
-	}
-	
-	private boolean containsSpecification(String value, Element[] array) {
-	    for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null && array[i].containsAttribute("specification") && array[i].getAttribute("specification").equals(value)) {
-                return true;
-            }
-        }
-        return false;
-	}
-	
-	
-	
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
deleted file mode 100644
index 07ee24c..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ConfigAdminTest.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-/**
- * Check configuration admin reconfiguration.
- */
-public class ConfigAdminTest extends OSGiTestCase {
-	
-	private ManagedServiceFactory getFactoryByName(String pid) {
-		ServiceReference[] refs;
-		try {
-			refs = getContext().getServiceReferences(ManagedServiceFactory.class.getName(), "(service.pid="+pid+")");
-			if(refs == null) { return null; }
-			return ((org.osgi.service.cm.ManagedServiceFactory) getContext().getService(refs[0]));
-		} catch (InvalidSyntaxException e) {
-			System.err.println("Cannot get the factory " + pid + " : " + e.getMessage());
-			return null;
-		}
-	}
-	
-	/**
-	 * Check creation.
-	 */
-	public void testCreation() {
-		ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
-		
-		Properties  p = new Properties();
-		p.put("int", new Integer(3));
-		p.put("long", new Long(42));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		try {
-			f.updated("ok2", p);
-			ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
-			assertNotNull("Check instance creation", ref);
-			f.deleted("ok2");
-			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
-			assertNull("Check instance deletion", ref);
-		} catch (ConfigurationException e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-	 * Check creation (push String).
-	 */
-	public void testCreationString() {
-        ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
-        
-        Properties  p = new Properties();
-        p.put("int", "3");
-        p.put("long", "42");
-        p.put("string", "absdir");
-        p.put("strAProp", "{a}");
-        p.put("intAProp", "{1,2}");
-        
-        try {
-            f.updated("ok2", p);
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
-            assertNotNull("Check instance creation", ref);
-            f.deleted("ok2");
-            ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "ok2");
-            assertNull("Check instance deletion", ref);
-        } catch (ConfigurationException e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check update and delete.
-	 */
-	public void testUpdate() {
-		ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
-		
-		Properties  p = new Properties();
-		p.put("int", new Integer(3));
-		p.put("long", new Long(42));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		try {
-			f.updated("okkkk", p);
-			ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-			assertNotNull("Check instance creation", ref);
-			p.put("int", new Integer("4"));
-			f.updated("okkkk", p);
-			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-			Integer test = (Integer) ref.getProperty("int");
-			assertEquals("Check instance modification", 4, test.intValue());
-			f.deleted("okkkk");
-			ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-			assertNull("Check instance deletion", ref);
-		} catch (ConfigurationException e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-
-    /**
-     * Check update and delete.
-     * (Push String).
-     */
-    public void testUpdateString() {
-    	ManagedServiceFactory f = getFactoryByName("Factories-FooProviderType-2");
-    	
-    	Properties  p = new Properties();
-    	p.put("int", "3");
-    	p.put("long", "42");
-    	p.put("string", "absdir");
-    	p.put("strAProp", "{a}");
-    	p.put("intAProp", "{1,2}");
-    	
-    	try {
-    		f.updated("okkkk", p);
-    		ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-    		assertNotNull("Check instance creation", ref);
-    		p.put("int", new Integer("4"));
-    		f.updated("okkkk", p);
-    		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-    		Integer test = (Integer) ref.getProperty("int");
-    		assertEquals("Check instance modification", 4, test.intValue());
-    		f.deleted("okkkk");
-    		ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), "okkkk");
-    		assertNull("Check instance deletion", ref);
-    	} catch (ConfigurationException e) {
-    		fail("An acceptable configuration is rejected : " + e.getMessage());
-    	}
-    }
-	
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
deleted file mode 100644
index f18359f..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryProps.java
+++ /dev/null
@@ -1,87 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.PropertyDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.factories.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class FactoryProps extends OSGiTestCase {
-	
-//	public void testImplementationClass() {
-//		ServiceReference ref1 = Utils.getServiceReferenceByName(context, Factory.class.getName(), "FooProviderType-1");
-//		assertNotNull("The factory is available", ref1);
-//		String clazz = (String) ref1.getProperty("component.class");
-//		assertEquals("Check the implementation class", clazz, FooProviderType1.class.getName());
-//	}
-	
-	public void testSimpleExposition() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-1");
-		assertNotNull("The factory is available", ref1);
-		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check array length", spec.length, 1);
-		assertEquals("Check spec", spec[0], FooService.class.getName());
-	}
-	
-	public void testDoubleExposition() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooBarProviderType-1");
-		assertNotNull("The factory is available", ref1);
-		String[] spec = (String[]) ref1.getProperty("component.providedServiceSpecifications");
-		assertEquals("Check array length", spec.length, 2);
-		assertContains("Check spec 1", spec, FooService.class.getName());
-		assertContains("Check spec 2", spec, BarService.class.getName());
-	}
-	
-	public void testProps() {
-		ServiceReference ref1 = Utils.getServiceReferenceByName(getContext(), Factory.class.getName(), "Factories-FooProviderType-Dyn2");
-		assertNotNull("The factory is available", ref1);
-		PropertyDescription[] pd = (PropertyDescription[]) ref1.getProperty("component.properties");
-		assertEquals("Check property list size", pd.length, 5);
-		
-		//P0
-		assertEquals("0) Check name", "int", pd[0].getName());
-		assertEquals("0) Check type", "int", pd[0].getType());
-		assertEquals("0) Check value", "4", pd[0].getValue());
-		
-		//P1
-		assertEquals("1) Check name", "boolean", pd[1].getName());
-		assertEquals("1) Check type", "boolean", pd[1].getType());
-		assertNull("1) Check value", pd[1].getValue());
-		
-		//P2
-		assertEquals("2) Check name", "string", pd[2].getName());
-		assertEquals("2) Check type",  String.class.getName(), pd[2].getType());
-		assertNull("2) Check value", pd[2].getValue());
-		
-		//P3
-		assertEquals("3) Check name", "strAProp", pd[3].getName());
-		assertEquals("3) Check type", "java.lang.String[]", pd[3].getType());
-		assertNull("3) Check value", pd[3].getValue());
-		
-		//P4
-		assertEquals("4) Check name", "intAProp", pd[4].getName());
-		assertEquals("4) Check type", "int[]", pd[4].getType());
-	}
-	
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
deleted file mode 100644
index 4338ef3..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/FactoryTestSuite.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class FactoryTestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Factories Test Suite", bc);
-        ots.addTestSuite(ComponentDesc.class);
-        ots.addTestSuite(UnacceptableConfigurationTest.class);
-        ots.addTestSuite(ConfigAdminTest.class);
-        ots.addTestSuite(ObedienceTest.class);
-        ots.addTestSuite(FactoryProps.class);
-        ots.addTestSuite(ReconfigurationTest.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
deleted file mode 100644
index c650d5c..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ObedienceTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentFactory;
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.factories.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Check that instances are disposed when the factory is stopped.
- */
-public class ObedienceTest extends OSGiTestCase {
-
-	public void testObedience() {
-		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
-		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(), "Factories-FooProviderType-1");
-		assertNotNull("Check factory existing", factory);
-		
-		Properties props1 = new Properties();
-		props1.put("instance.name","foo1");
-		Properties props2 = new Properties();
-		props2.put("instance.name","foo2");
-		
-		ComponentInstance ci1 = null, ci2 = null;
-		try {
-			ci1 = factory.createComponentInstance(props1);
-			ci2 = factory.createComponentInstance(props2);
-		} catch(Exception e) {
-			fail("Cannot instantiate foo providers : " + e.getMessage());
-		}
-		
-		assertTrue("Check foo1 validity", ci1.getState() == ComponentInstance.VALID);
-		assertTrue("Check foo2 validity", ci2.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check foo service", getContext().getServiceReference(FooService.class.getName()));
-		assertEquals("Check the number of Foo", Utils.getServiceReferences(getContext(), FooService.class.getName(), null).length, 2);
-		
-		factory.stop();
-		
-		assertTrue("Check foo1 invalidity ("+ci1.getState()+")", ci1.getState() == ComponentInstance.DISPOSED);
-		assertTrue("Check foo2 invalidity ("+ci1.getState()+")", ci2.getState() == ComponentInstance.DISPOSED);
-		
-		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
-		
-		factory.start();
-		assertNull("Check no foo service", getContext().getServiceReference(FooService.class.getName()));
-	}
-	
-	public void testDisposeAfterFactoryInvalidation() {
-	    ComponentFactory cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
-	    assertNotNull("Check factory availability -1", cf);
-	    assertEquals("Check factory state -1", Factory.VALID, cf.getState());
-	    
-	    ServiceReference ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
-	    assertNotNull("Check Architecture availability -1", ref_arch);
-	    
-        HandlerManagerFactory hf = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
-        assertNotNull("Check handler availability -1", hf);
-        assertEquals("Check handler state -1", Factory.VALID, hf.getState());
-        
-        // Stop the handler
-        hf.stop();
-        HandlerManagerFactory hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
-        assertNull("Check handler availability -2", hf2);
-        
-        // Check the factory invalidity
-        cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
-        assertNotNull("Check factory availability -2", cf);
-        assertEquals("Check factory state -2", Factory.INVALID, cf.getState());
-        
-        // Check the instance disparition
-        ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
-        assertNull("Check Architecture availability -1", ref_arch);
-        
-        // Restart the handler
-        hf.start();
-        hf2 = (HandlerManagerFactory) Utils.getHandlerFactoryByName(getContext(), "controller");
-        assertNotNull("Check handler availability -3", hf2);
-        
-        // Check the factory state
-        cf = (ComponentFactory) Utils.getFactoryByName(getContext(), "org.apache.felix.ipojo.test.scenarios.component.SimpleType");
-        assertNotNull("Check factory availability -3", cf);
-        assertEquals("Check factory state -3", Factory.VALID, cf.getState());
-        
-        
-        // Check the instance re-creation
-        ref_arch = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), "SimpleInstance");
-        assertNotNull("Check Architecture availability -3", ref_arch);
-        
-	}
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ReconfigurationTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ReconfigurationTest.java
deleted file mode 100644
index 08edfe0..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/ReconfigurationTest.java
+++ /dev/null
@@ -1,335 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import java.io.IOException;
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentFactory;
-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.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.service.cm.Configuration;
-import org.osgi.service.cm.ConfigurationAdmin;
-
-public class ReconfigurationTest extends OSGiTestCase {
-
-	 private ConfigurationAdmin admin;
-
-	 public void setUp() {
-	        admin = (ConfigurationAdmin) Utils.getServiceObject(getContext(), ConfigurationAdmin.class.getName(), null);
-	        assertNotNull("Check configuration admin availability", admin);
-	        try {
-	            Configuration[] configurations = admin.listConfigurations(
-	            		"(service.factoryPid=org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType)");
-	            for (int i = 0; configurations != null && i < configurations.length; i++) {
-	                configurations[i].delete();
-	            }
-	        } catch (IOException e) {
-	            // TODO Auto-generated catch block
-	            e.printStackTrace();
-	        } catch (InvalidSyntaxException e) {
-	            // TODO Auto-generated catch block
-	            e.printStackTrace();
-	        }
-	    }
-
-	    public void tearDown() {
-	        try {
-	            Configuration[] configurations = admin.listConfigurations(
-	            		"(service.factoryPid=org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType)");
-	            for (int i = 0; configurations != null && i < configurations.length; i++) {
-	                configurations[i].delete();
-	            }
-	        } catch (IOException e) {
-	            // TODO Auto-generated catch block
-	            e.printStackTrace();
-	        } catch (InvalidSyntaxException e) {
-	            // TODO Auto-generated catch block
-	            e.printStackTrace();
-	        }
-	        admin = null;
-
-
-	    }
-
-	public void testRevalidationOnReconfiguration() {
-		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(),
-				"org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType");
-
-		// First inject a configuration triggering an exception of the validate method.
-		Properties props = new Properties();
-		props.put("prop", "KO");
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch (UnacceptableConfiguration e) {
-			e.printStackTrace();
-		} catch (MissingHandlerException e) {
-			e.printStackTrace();
-		} catch (ConfigurationException e) {
-			e.printStackTrace();
-		}
-
-		assertNotNull(ci);
-		assertEquals("instance invalid", ComponentInstance.STOPPED, ci.getState());
-
-		// Reconfigure
-		props = new Properties();
-		props.put("prop", "OK");
-
-		ci.reconfigure(props);
-
-		assertNotNull(ci);
-		assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
-	}
-
-	public static long UPDATE_WAIT_TIME = 2000;
-
-	public void testRevalidationOnReconfigurationUsingConfigAdmin() throws InvalidSyntaxException {
-		Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType", null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-		// First inject a configuration triggering an exception of the validate method.
-		props.put("prop", "KO");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        String pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        Assert.assertNull("No architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-
-
-		// Reconfigure
-		props = new Properties();
-		props.put("prop", "OK");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        Assert.assertNotNull("architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-
-        Assert.assertEquals("Is valid ?", ComponentInstance.VALID, arch.getInstanceDescription().getState());
-	}
-
-	public void testRevalidationOnReconfigurationWithController() {
-		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(),
-				"org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType2");
-
-		// First inject a configuration triggering an exception of the validate method.
-		Properties props = new Properties();
-		props.put("prop", "KO");
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch (UnacceptableConfiguration e) {
-			e.printStackTrace();
-		} catch (MissingHandlerException e) {
-			e.printStackTrace();
-		} catch (ConfigurationException e) {
-			e.printStackTrace();
-		}
-
-		assertNotNull(ci);
-		assertEquals("instance invalid", ComponentInstance.INVALID, ci.getState()); // Controller effect.
-
-		// Reconfigure
-		props = new Properties();
-		props.put("prop", "OK");
-
-		ci.reconfigure(props);
-
-		assertNotNull(ci);
-		assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
-	}
-
-	public void testRevalidationOnReconfigurationUsingConfigAdminAndController() throws InvalidSyntaxException {
-		Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType2",
-            		null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-		// First inject a configuration triggering an exception of the validate method.
-		props.put("prop", "KO");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        String pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        // Invalid ... controller effect
-        Assert.assertNotNull("architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-
-        Assert.assertEquals("Is invalid ?", ComponentInstance.INVALID, arch.getInstanceDescription().getState());
-
-		// Reconfigure
-		props = new Properties();
-		props.put("prop", "OK");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        Assert.assertNotNull("architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        arch = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-
-        Assert.assertEquals("Is valid ?", ComponentInstance.VALID, arch.getInstanceDescription().getState());
-	}
-
-	public void testRevalidationOnReconfigurationOfTheController() {
-		ComponentFactory factory = (ComponentFactory) Utils.getFactoryByName(getContext(),
-				"org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType3");
-
-		// First inject a configuration triggering an exception of the validate method.
-		Properties props = new Properties();
-		props.put("controller", "false");
-		ComponentInstance ci = null;
-		try {
-			ci = factory.createComponentInstance(props);
-		} catch (UnacceptableConfiguration e) {
-			e.printStackTrace();
-		} catch (MissingHandlerException e) {
-			e.printStackTrace();
-		} catch (ConfigurationException e) {
-			e.printStackTrace();
-		}
-
-		assertNotNull(ci);
-		assertEquals("instance invalid", ComponentInstance.INVALID, ci.getState()); // Controller effect.
-
-		// Reconfigure
-		props = new Properties();
-		props.put("controller", "true");
-
-		ci.reconfigure(props);
-
-		assertNotNull(ci);
-		assertEquals("instance valid", ComponentInstance.VALID, ci.getState());
-	}
-
-	public void testRevalidationOnReconfigurationUsingConfigAdminOfTheController() throws InvalidSyntaxException {
-		Configuration configuration = null;
-        try {
-            configuration = admin.createFactoryConfiguration("org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType3",
-            		null);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-        Dictionary props = configuration.getProperties();
-        if(props == null) {
-            props = new Properties();
-        }
-		// First inject a configuration triggering an exception of the validate method.
-		props.put("controller", "false");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        String pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        // Invalid ... controller effect
-        Assert.assertNotNull("architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        Architecture arch = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-
-        Assert.assertEquals("Is invalid ?", ComponentInstance.INVALID, arch.getInstanceDescription().getState());
-
-		// Reconfigure
-		props = new Properties();
-		props.put("controller", "true");
-
-		try {
-            configuration.update(props);
-        } catch (IOException e) {
-            fail(e.getMessage());
-        }
-
-        pid = configuration.getPid();
-
-        // Wait for the processing of the first configuration.
-        try {
-            Thread.sleep(UPDATE_WAIT_TIME);
-        } catch (InterruptedException e1) {
-            fail(e1.getMessage());
-        }
-
-        Assert.assertNotNull("architecture", getContext().getServiceReferences(Architecture.class.getName(), "(architecture.instance="+pid+")"));
-        arch = (Architecture) Utils.getServiceObject(getContext(), Architecture.class.getName(), "(architecture.instance="+pid+")");
-
-        Assert.assertEquals("Is valid ?", ComponentInstance.VALID, arch.getInstanceDescription().getState());
-	}
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
deleted file mode 100644
index 9c7ba67..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/UnacceptableConfigurationTest.java
+++ /dev/null
@@ -1,777 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-
-/**
- * Test unacceptable configuration.
- */
-public class UnacceptableConfigurationTest extends OSGiTestCase {
-
-	/**
-	 * Configuration without the name property.
-	 */
-	public void testWithoutName() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-		
-		Properties  p = new Properties();
-		p.put("int", new Integer(3));
-		p.put("long", new Long(42));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) { 
-		    fail("an acceptable configuration is refused : " + e.getMessage());
-		    e.printStackTrace();
-		}
-		
-	}
-	
-	/**
-     * Configuration without the name property.
-     */
-    public void testWithoutNameOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
-        
-        Properties  p = new Properties();
-        p.put("int", new Integer(3));
-        p.put("long", new Long(42));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) { fail("an acceptable configuration is refused : " + e.getMessage()); }
-        
-    }
-	
-	/**
-	 * Empty configuration.
-	 */
-	public void testEmptyConfiguration() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-		Properties  p = new Properties();
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) { fail("An acceptable configuration is refused"); }
-	}
-	
-	/**
-     * Empty configuration.
-     */
-    public void testEmptyConfigurationOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
-        Properties  p = new Properties();
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) { fail("An acceptable configuration is refused"); }
-    }
-	
-	/**
-	 * Empty configuration (just the name).
-	 */
-	public void testEmptyConfiguration2() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		Properties  p = new Properties();
-		p.put("instance.name","ko");
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) { return; }
-		
-		fail("An unacceptable configuration is accepted");
-	}
-	
-	/**
-     * Empty configuration (just the name).
-     */
-    public void testEmptyConfiguration2opt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        Properties  p = new Properties();
-        p.put("instance.name","ko");
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) { 
-            fail("An acceptable configuration is refused");
-        }
-        
-    }
-	
-	/**
-	 * Null configuration (accept).
-	 */
-	public void testNull() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(null);
-			ci.dispose();
-		} catch(Exception e) { fail("An acceptable configuration is refused"); }
-	}
-	
-	/**
-     * Null configuration (accept).
-     */
-    public void testNullOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(null);
-            ci.dispose();
-        } catch(Exception e) { fail("An acceptable configuration is refused"); }
-    }
-	
-	/**
-	 * Null configuration (fail).
-	 */
-	public void testNull2() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(null);
-			ci.dispose();
-		} catch(Exception e) { return; }
-		
-		fail("An unacceptable configuration is accepted");
-	}
-	
-	/**
-     * Null configuration (success).
-     */
-    public void testNull2Opt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(null);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is refused");
-        }
-        
-        
-    }
-	
-	/**
-	 * Check static properties.
-	 */
-	public void testStaticOK() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("long", new Long(42));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check static properties.
-     */
-    public void testStaticOKopt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("long", new Long(42));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check dynamic properties.
-	 */
-	public void testDynamicOK() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-		    e.printStackTrace();
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	
-	/**
-     * Check dynamic properties.
-     */
-    public void testDynamicOKopt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dynopt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            e.printStackTrace();
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-        
-        p = new Properties();
-        p.put("instance.name","ok");
-        p.put("boolean", new Boolean(true));
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            e.printStackTrace();
-            fail("An acceptable configuration is rejected (2) : " + e.getMessage());
-        }
-    }
-    
-	/**
-	 * Check inconsistent types.
-	 */
-	public void testDynamicBadType() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("long", new Long(42));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check inconsistent types.
-     */
-    public void testDynamicBadTypeOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dynopt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("long", new Long(42));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-        
-        p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected (2) : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check good configuration (with overriding).
-	 */
-	public void testDynamicComplete() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check good configuration (with overriding).
-     */
-    public void testDynamicCompleteOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-        
-        
-        p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected (2) : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check good configuration.
-	 */
-	public void testDynamicJustEnough() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check good configuration.
-     */
-    public void testDynamicJustEnoughOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-        
-        p = new Properties();
-        p.put("instance.name","ok");
-        p.put("boolean", new Boolean(true));
-        p.put("strAProp", new String[] {"a"});
-        
-        ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check good configuration.
-	 */
-	public void testDynamicMix() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check good configuration.
-     */
-    public void testDynamicMixOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-        
-        p = new Properties();
-        p.put("instance.name","ok");
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check uncomplete configuration.
-	 */
-	public void testDynamicUncomplete() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) { return; }
-		
-		fail("An unacceptable configuration is accepted");
-	}
-	
-	/**
-     * Check uncomplete configuration.
-     */
-    public void testDynamicUncompleteOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) { fail("An acceptable configuration is refused"); }
-        
-        
-    }
-	
-	/**
-	 * Check good configuration (more properties).
-	 */
-	public void testDynamicMore() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		p.put("tralala", "foo");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check good configuration (more properties).
-     */
-    public void testDynamicMoreOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        p.put("tralala", "foo");
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-	
-	/**
-	 * Check properties affecting services and component.
-	 */
-	public void testDoubleProps() {
-		Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2");
-		
-		Properties  p = new Properties();
-		p.put("instance.name","ok");
-		p.put("int", new Integer(3));
-		p.put("boolean", new Boolean(true));
-		p.put("string", "absdir");
-		p.put("strAProp", new String[] {"a"});
-		p.put("intAProp", new int[] {1,2});
-		p.put("boolean", new Boolean(false));
-		p.put("string", "toto");
-		
-		ComponentInstance ci = null;
-		try {
-			ci = f.createComponentInstance(p);
-			ci.dispose();
-		} catch(Exception e) {
-			fail("An acceptable configuration is rejected : " + e.getMessage());
-		}
-	}
-	
-	/**
-     * Check properties affecting services and component.
-     */
-    public void testDoublePropsOpt() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-Dyn2opt");
-        
-        Properties  p = new Properties();
-        p.put("instance.name","ok");
-        p.put("int", new Integer(3));
-        p.put("boolean", new Boolean(true));
-        p.put("string", "absdir");
-        p.put("strAProp", new String[] {"a"});
-        p.put("intAProp", new int[] {1,2});
-        p.put("boolean", new Boolean(false));
-        p.put("string", "toto");
-        
-        ComponentInstance ci = null;
-        try {
-            ci = f.createComponentInstance(p);
-            ci.dispose();
-        } catch(Exception e) {
-            fail("An acceptable configuration is rejected : " + e.getMessage());
-        }
-    }
-    
-    /**
-     * Check instance name unicity.
-     */
-    public void testUnicity1() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-        
-        ComponentInstance ci1,ci2, ci3 = null;
-        try {
-            ci1 = f.createComponentInstance(null);
-            ci2 = f.createComponentInstance(null);
-            ci3 = f.createComponentInstance(null);
-            assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());
-            assertNotEquals("Check name ci1, ci3", ci1.getInstanceName(), ci3.getInstanceName());
-            assertNotEquals("Check name ci3, ci2", ci3.getInstanceName(), ci2.getInstanceName());
-            ci1.dispose();
-            ci2.dispose();
-            ci3.dispose();
-        } catch(Exception e) { fail("An acceptable configuration is refused"); }
-    }
-    
-    /**
-     * Check instance name unicity.
-     */
-    public void testUnicity2() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-        
-        ComponentInstance ci1,ci2, ci3 = null;
-        try {
-            Properties p1 = new Properties();
-            p1.put("instance.name","name1");
-            ci1 = f.createComponentInstance(p1);
-            Properties p2 = new Properties();
-            p2.put("instance.name","name2");
-            ci2 = f.createComponentInstance(p2);
-            Properties p3 = new Properties();
-            p3.put("instance.name","name3");
-            ci3 = f.createComponentInstance(p3);
-            assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());
-            assertNotEquals("Check name ci1, ci3", ci1.getInstanceName(), ci3.getInstanceName());
-            assertNotEquals("Check name ci3, ci2", ci3.getInstanceName(), ci2.getInstanceName());
-            ci1.dispose();
-            ci2.dispose();
-            ci3.dispose();
-        } catch(Exception e) { fail("An acceptable configuration is refused"); }
-    }
-    
-    /**
-     * Check instance name unicity.
-     */
-    public void testUnicity3() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-        
-        ComponentInstance ci1 = null,ci2 = null;
-        try {
-            Properties p1 = new Properties();
-            p1.put("instance.name","name1");
-            ci1 = f.createComponentInstance(p1);
-            Properties p2 = new Properties();
-            p2.put("instance.name","name1");
-            ci2 = f.createComponentInstance(p2);
-            assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());
-            ci1.dispose();
-            ci2.dispose();
-        } catch(Exception e) { 
-            ci1.dispose();
-            return; }
-          
-          fail("An unacceptable configuration is acceptable");
-    }
-    
-    /**
-     * Check instance name unicity.
-     */
-    public void testUnicity4() {
-        Factory f = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-2");
-        Factory f2 = Utils.getFactoryByName(getContext(), "Factories-FooProviderType-1");
-        
-        ComponentInstance ci1 = null,ci2 = null;
-        try {
-            Properties p1 = new Properties();
-            p1.put("instance.name","name1");
-            ci1 = f.createComponentInstance(p1);
-            Properties p2 = new Properties();
-            p2.put("instance.name","name1");
-            ci2 = f2.createComponentInstance(p2);
-            assertNotEquals("Check name ci1, ci2", ci1.getInstanceName(), ci2.getInstanceName());
-            ci1.dispose();
-            ci2.dispose();
-        } catch(Exception e) { 
-            ci1.dispose();
-            return; }
-          
-          fail("An unacceptable configuration is acceptable");
-    }
-	
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java
deleted file mode 100644
index e29c179..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java
deleted file mode 100644
index 3fd1e2f..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java
deleted file mode 100644
index 9ba67c9..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/factories/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.factories.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 8fa2fda..0000000
--- a/ipojo/tests/core/factories/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(HandlerFactory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-    public static void waitForService(BundleContext context, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(context, itf, filter);
-        int count = 0;
-        if (refs.length != 0) {
-            return;
-        } else {
-            while(refs.length == 0) {
-                try {
-                    Thread.sleep(5);
-                } catch (InterruptedException e) {
-                    // Interrupted
-                }
-                count++;
-                if (count == 100) {
-                    throw new RuntimeException("Timeout ... no services match with " + filter);
-                }
-                refs = getServiceReferences(context, itf, filter);
-            }
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/factories/src/main/resources/metadata.xml b/ipojo/tests/core/factories/src/main/resources/metadata.xml
deleted file mode 100644
index cd72f96..0000000
--- a/ipojo/tests/core/factories/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<!-- Simple provider  -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Factories-FooProviderType-1" architecture="true">
-		<provides />
-	</component>
-
-	<!-- Provider providing 2 services -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
-		name="Factories-FooBarProviderType-1" architecture="true">
-		<provides />
-	</component>
-
-	<!-- Provider with dynamic property -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="Factories-FooProviderType-Dyn" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="2" mandatory="true"/>
-			<property name="boolean" field="boolProp" value="false" mandatory="true"/>
-			<property name="string" field="strProp" value="foo" mandatory="true"/>
-			<property name="strAProp" field="strAProp"
-				value="{foo, bar}" mandatory="true"/>
-			<property name="intAProp" field="intAProp" value="{ 1,2,3}" mandatory="true"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="Factories-FooProviderType-Dynopt" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="2"/>
-			<property name="boolean" field="boolProp" value="false"/>
-			<property name="string" field="strProp" value="foo"/>
-			<property name="strAProp" field="strAProp"
-				value="{foo, bar}"/>
-			<property name="intAProp" field="intAProp" value="{ 1,2,3}"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Factories-FooProviderType-2" architecture="true">
-		<provides>
-			<property name="int" type="int" value="2" mandatory="true" />
-			<property name="long" type="long" value="40" mandatory="true"/>
-			<property name="string" type="java.lang.String" value="foo" mandatory="true"/>
-			<property name="strAProp" type="java.lang.String[]"
-				value="{foo, bar}" mandatory="true" />
-			<property name="intAProp" type="int[]" value="{1,2,3}" mandatory="true"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Factories-FooProviderType-2opt" architecture="true">
-		<provides>
-			<property name="int" type="int" value="2"/>
-			<property name="long" type="long" value="40"/>
-			<property name="string" type="java.lang.String" value="foo"/>
-			<property name="strAProp" type="java.lang.String[]"
-				value="{foo, bar}" />
-			<property name="intAProp" type="int[]" value="{1,2,3}"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
-		name="Factories-FooProviderType-Dyn2" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="4" mandatory="true"/>
-			<property name="boolean" field="boolProp" mandatory="true"/>
-			<property name="string" field="strProp" mandatory="true"/>
-			<property name="strAProp" field="strAProp" mandatory="true"/>
-			<property name="intAProp" field="intAProp"
-				value="{1, 2,3 }" mandatory="true"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
-		name="Factories-FooProviderType-Dyn2opt" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="4" />
-			<property name="boolean" field="boolProp"/>
-			<property name="string" field="strProp"/>
-			<property name="strAProp" field="strAProp"/>
-			<property name="intAProp" field="intAProp"
-				value="{1, 2,3 }"/>
-		</provides>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Factories-FooProviderType-3" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo" mandatory="true"/>
-			<property name="bar" field="m_bar" mandatory="true"/>
-			<property name="baz" type="java.lang.String" mandatory="true"/>
-		</provides>
-		<properties propagation="true">
-			<property name="foo" field="m_foo" mandatory="true"/>
-			<property name="bar" field="m_bar" mandatory="true"/>
-		</properties>
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Factories-FooProviderType-3opt" architecture="true">
-		<provides>
-			<property name="foo" field="m_foo"/>
-			<property name="bar" field="m_bar"/>
-			<property name="baz" type="java.lang.String"/>
-		</provides>
-		<properties propagation="true">
-			<property name="foo" field="m_foo"/>
-			<property name="bar" field="m_bar"/>
-		</properties>
-	</component>
-
-	<!-- type & instance used to check instance lifecycle against factory validation & invalidation -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.SimpleType" architecture="true">
-		<controller field="m_controller"/>
-	</component>
-	<instance component="org.apache.felix.ipojo.test.scenarios.component.SimpleType" name="SimpleInstance"/>
-
-	<!-- check that instance state is recomputed after reconfiguration -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType" architecture="true">
-		<properties>
-			<property name="prop" field="prop"/>
-			<property name="x" method="setX" value="x"/>
-		</properties>
-		<callback transition="validate" method="start"/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType"
-		name="org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType2"
-		architecture="true" immediate="true">
-		<properties>
-			<property name="prop" method="setProp"/>
-			<property name="x" method="setX" value="x"/>
-		</properties>
-		<controller field="controller"/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType"
-		name="org.apache.felix.ipojo.test.scenarios.component.ReconfigurableSimpleType3"
-		architecture="true" immediate="true">
-		<properties>
-			<property name="controller" method="setController" field="controller"/>
-			<property name="x" method="setX" value="x"/>
-		</properties>
-		<controller field="controller"/>
-	</component>
-</ipojo>
diff --git a/ipojo/tests/core/factory-version/cons.xml b/ipojo/tests/core/factory-version/cons.xml
deleted file mode 100644
index 69f729a..0000000
--- a/ipojo/tests/core/factory-version/cons.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<component name="cons" classname="org.apache.felix.ipojo.tests.core.component.MyCons">
-		<requires field="services"/>
-	</component>
-	<instance component="cons" name="mycons"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/factory-version/instances.xml b/ipojo/tests/core/factory-version/instances.xml
deleted file mode 100644
index 500d161..0000000
--- a/ipojo/tests/core/factory-version/instances.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-
-	<instance component="org.apache.felix.ipojo.tests.core.component.MyComponent"
-		version="1.0"
-		name="instance-v1"
-	/>
-
-	<instance component="org.apache.felix.ipojo.tests.core.component.MyComponent"
-		version="1.1"
-		name="instance-v1.1"
-	/>
-
-	<instance component="org.apache.felix.ipojo.tests.core.component.MyComponent"
-		name="instance-any"
-	/>
-
-	<instance component="MyComponent"
-		name="MyComponentInstance"
-	/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/factory-version/pom.xml b/ipojo/tests/core/factory-version/pom.xml
deleted file mode 100644
index d15c426..0000000
--- a/ipojo/tests/core/factory-version/pom.xml
+++ /dev/null
@@ -1,155 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.core.factory-version</artifactId>
-  <name>iPOJO Factory Version Test Suite</name>
-  <version>${ipojo.core.snapshot}</version>
-  <description>Test the factory version attribute</description>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <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> <executions>
-        <execution> <id>generate-paxexam-config</id> <goals>
-        <goal>generate-paxexam-config</goal> </goals> </execution>
-        </executions> <configuration> <settings> <platform>felix</platform>
-        </settings> </configuration> </plugin>
-      -->
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-
-  <!--
-    Pax Exam API:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <!--
-    During runtime Pax Exam will discover the OSGi container to use by
-    searching metadata available into classpath. Pax Exam comes with a
-    default container that uses [Pax Runner] for implementing the
-    container requirements:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-container-default
-    </artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <!--
-    If your test code is based on JUnit you will have to have the Junit
-    support artifact:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-junit</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <dependency>
-    <groupId>junit</groupId>
-    <artifactId>junit</artifactId>
-    <version>4.5</version>
-    <type>jar</type>
-    <scope>test</scope>
-  </dependency>
-  <!--  Tinybundles -->
-  <dependency>
-    <groupId>org.ops4j.pax.swissbox</groupId>
-    <artifactId>pax-swissbox-tinybundles</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>tinybundles-ipojo</artifactId>
-  </dependency>
-
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>osgi-helpers</artifactId>
-    </dependency>
-
-   <dependency>
-    <groupId>org.ops4j.base</groupId>
-    <artifactId>ops4j-base-io</artifactId>
-    <version>1.2.1</version>
-  </dependency>
-  <dependency>
-    <groupId>org.ops4j.base</groupId>
-    <artifactId>ops4j-base-lang</artifactId>
-    <version>1.2.1</version>
-  </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-</project>
diff --git a/ipojo/tests/core/factory-version/provider-v1.1.xml b/ipojo/tests/core/factory-version/provider-v1.1.xml
deleted file mode 100644
index 6d387b6..0000000
--- a/ipojo/tests/core/factory-version/provider-v1.1.xml
+++ /dev/null
@@ -1,7 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent" version="BuNdlE">
-		<provides/>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/factory-version/provider-v1.xml b/ipojo/tests/core/factory-version/provider-v1.xml
deleted file mode 100644
index a89195d..0000000
--- a/ipojo/tests/core/factory-version/provider-v1.xml
+++ /dev/null
@@ -1,12 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent" version="1.0">
-		<provides/>
-	</component>
-
-
-	<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent" name="MyComponent">
-		<provides/>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java b/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java
deleted file mode 100644
index 9db5b2e..0000000
--- a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/FactoryVersionTest.java
+++ /dev/null
@@ -1,183 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class FactoryVersionTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        // mavenBundle().groupId( "org.ops4j.pax.swissbox" ).artifactId( "pax-swissbox-tinybundles" ).version(asInProject())
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                           .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                           .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withBnd() )
-                    ),
-               provision(
-                       // Component V1
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ProviderV1")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withiPOJO(new File(tmp, "provider-v1.jar"), new File("provider-v1.xml"))),
-                     // Component V1.1 (Bundle Version)
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ProviderV1.1")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .set(Constants.BUNDLE_VERSION, "1.1")
-                            .build( withiPOJO(new File(tmp, "provider-v1.1.jar"), new File("provider-v1.1.xml"))),
-                // Instance declaration
-                newBundle()
-                    .set(Constants.BUNDLE_SYMBOLICNAME,"Instances")
-                    .build( withiPOJO(new File(tmp, "instances.jar"), new File("instances.xml")))
-                    )
-                );
-        return opt;
-    }
-
-    @Test
-    public void testDeploy() {
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
-        }
-    }
-
-    @Test
-    public void testInstanceArchitecture() {
-          // Version 1.0
-          ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "instance-v1");
-          Assert.assertNotNull(refv1);
-          Architecture archv1 = (Architecture) osgi.getServiceObject(refv1);
-
-          String version = archv1.getInstanceDescription().getComponentDescription().getVersion();
-          Assert.assertEquals("1.0", version);
-
-          // Version 1.1
-          ServiceReference refv11 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "instance-v1.1");
-          Assert.assertNotNull(refv11);
-          Architecture archv11 = (Architecture) osgi.getServiceObject(refv11);
-
-          String version11 = archv11.getInstanceDescription().getComponentDescription().getVersion();
-          Assert.assertEquals("1.1", version11);
-
-          // No Version
-          ServiceReference refany = ipojo.getServiceReferenceByName(Architecture.class.getName(), "instance-any");
-          Assert.assertNotNull(refany);
-          Architecture archany = (Architecture) osgi.getServiceObject(refany);
-
-          String any = archany.getInstanceDescription().getComponentDescription().getVersion();
-          Assert.assertNotNull(any);
-
-          // No version set in the factory, so no version.
-          ServiceReference refmci = ipojo.getServiceReferenceByName(Architecture.class.getName(), "MyComponentInstance");
-          Assert.assertNotNull(refmci);
-          Architecture archmcy = (Architecture) osgi.getServiceObject(refmci);
-
-          String mci = archmcy.getInstanceDescription().getComponentDescription().getVersion();
-          Assert.assertNull(mci);
-
-    }
-
-    @Test
-    public void testServiceProperty() throws InvalidSyntaxException {
-
-          // Version 1.0
-          //ServiceReference refv1 = ipojo.getServiceReferenceByName(MyService.class.getName(), "instance-v1");
-          ServiceReference[] refv1 = context.getAllServiceReferences(MyService.class.getName(), "(instance.name=instance-v1)");
-          Assert.assertNotNull(refv1);
-          String version = (String) refv1[0].getProperty("factory.version");
-          Assert.assertEquals("1.0", version);
-
-          // Version 1.1
-          ServiceReference[] refv11 = context.getAllServiceReferences(MyService.class.getName(), "(instance.name=instance-v1.1)");
-          //ServiceReference refv11 = ipojo.getServiceReferenceByName(MyService.class.getName(), "instance-v1.1");
-          Assert.assertNotNull(refv11);
-          String version11 = (String) refv11[0].getProperty("factory.version");
-
-          Assert.assertEquals("1.1", version11);
-
-          // No Version
-          ServiceReference[] refany = context.getAllServiceReferences(MyService.class.getName(), "(instance.name=instance-any)");
-
-          // ServiceReference refany = ipojo.getServiceReferenceByName(MyService.class.getName(), "instance-any");
-          Assert.assertNotNull(refany);
-          String any = (String) refany[0].getProperty("factory.version");
-          Assert.assertNotNull(any);
-
-          // No version set in the factory, so no version.
-          ServiceReference[] refmci = context.getAllServiceReferences(MyService.class.getName(), "(instance.name=MyComponentInstance)");
-          //ServiceReference refmci = ipojo.getServiceReferenceByName(MyService.class.getName(), "MyComponentInstance");
-          Assert.assertNotNull(refmci);
-          String mci = (String) refmci[0].getProperty("factory.version");
-          Assert.assertNull(mci);
-    }
-
-
-}
diff --git a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java b/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
deleted file mode 100644
index 1d8de78..0000000
--- a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/VersionConflictTest.java
+++ /dev/null
@@ -1,315 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.MavenUtils.asInProject;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.MalformedURLException;
-
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.handlers.dependency.Dependency;
-import org.apache.felix.ipojo.handlers.dependency.DependencyDescription;
-import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.component.MyCons;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.io.StreamUtils;
-import org.ops4j.lang.NullArgumentException;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.ExportedPackage;
-import org.osgi.service.packageadmin.PackageAdmin;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class VersionConflictTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-
-    @Configuration
-    public static Option[] configure() throws NullArgumentException, FileNotFoundException, IOException {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        File f1 = new File(tmp, "service-interface-v1.jar");
-        StreamUtils.copyStream(
-                newBundle()
-                .add( MyService.class )
-               .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterfaceV1")
-               .set(Constants.BUNDLE_VERSION, "1.0.0")
-               .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"1.0.0\"")
-               .build( withBnd()),
-                new FileOutputStream(f1),
-                true);
-
-        File f2 = new File(tmp, "service-interface-v2.jar");
-        StreamUtils.copyStream(
-                newBundle()
-                .add( MyService.class )
-                .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterfaceV2")
-                .set(Constants.BUNDLE_VERSION, "2.0.0")
-                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"2.0.0\"")
-                .build( withBnd()),
-                new FileOutputStream(f2),
-                true);
-
-        File c1 = new File(tmp, "component-v1.jar");
-        StreamUtils.copyStream(
-                newBundle()
-               .add(MyComponent.class)
-               .set(Constants.BUNDLE_SYMBOLICNAME,"ProviderV1")
-               .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"[1.0.0, 1.0.0]\"")
-               .build( withiPOJO(new File("vprovider-v1.xml"))),
-               new FileOutputStream(c1),
-               true);
-
-        File c2 = new File(tmp, "component-v2.jar");
-        StreamUtils.copyStream(
-                newBundle()
-               .add(MyComponent.class)
-               .set(Constants.BUNDLE_SYMBOLICNAME,"ProviderV2")
-               .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"[2.0.0, 2.0.0]\"")
-               .build( withiPOJO(new File("vprovider-v2.xml"))),
-               new FileOutputStream(c2),
-               true);
-
-        File cons = new File(tmp, "cons.jar");
-        StreamUtils.copyStream(
-                newBundle()
-               .add(MyCons.class)
-               .set(Constants.BUNDLE_SYMBOLICNAME,"MyCons")
-               .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"[2.0.0, 2.0.0]\"")
-               .set(Constants.BUNDLE_VERSION, "2.0")
-               .build(withiPOJO(new File("cons.xml"))),
-               new FileOutputStream(cons),
-               true);
-
-        File consV1 = new File(tmp, "cons-v1.jar");
-        StreamUtils.copyStream(
-                newBundle()
-               .add(MyCons.class)
-               .set(Constants.BUNDLE_SYMBOLICNAME,"MyCons")
-               .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service; version=\"[1.0.0, 1.0.0]\"")
-               .set(Constants.BUNDLE_VERSION, "1.0")
-               .build(withiPOJO(new File("cons.xml"))),
-               new FileOutputStream(consV1),
-               true);
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject(),                        mavenBundle().groupId("org.ops4j.base").artifactId("ops4j-base-lang").versionAsInProject()
-//                        mavenBundle().groupId( "org.ops4j.pax.swissbox" ).artifactId( "pax-swissbox-tinybundles" ).version(asInProject())
-                        ),
-                        systemProperty( "url1" ).value( f1.toURI().toURL().toExternalForm() ),
-                        systemProperty( "url2" ).value( f2.toURI().toURL().toExternalForm() ),
-
-                        systemProperty( "c1" ).value( c1.toURI().toURL().toExternalForm() ),
-                        systemProperty( "c2" ).value( c2.toURI().toURL().toExternalForm() ),
-                        systemProperty( "cons" ).value( cons.toURI().toURL().toExternalForm() ),
-                        systemProperty( "consV1" ).value( consV1.toURI().toURL().toExternalForm() )
-                );
-        return opt;
-    }
-
-    @Test
-    public void deployBundlesAtRuntime() throws MalformedURLException, BundleException, InvalidSyntaxException {
-
-       Bundle b1 = context.installBundle(context.getProperty("url1"));
-       b1.start();
-
-
-       Bundle b3 = context.installBundle(context.getProperty("c1"));
-       b3.start();
-
-        Bundle b2 = context.installBundle(context.getProperty("url2"));
-        b2.start();
-
-        Bundle b4 = context.installBundle(context.getProperty("c2"));
-        b4.start();
-
-        Bundle b5 = context.installBundle(context.getProperty("cons"));
-        b5.start();
-
-
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            System.out.println("bundle " + bundles[i].getSymbolicName() + " : " + (bundles[i].getState() == Bundle.ACTIVE));
-            //Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
-        }
-
-
-        PackageAdmin pa = osgi.getPackageAdmin();
-        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
-        ExportedPackage[] packages = pa.getExportedPackages(b);
-        if (packages == null) {
-            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
-        } else {
-            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
-            for (ExportedPackage p : packages) {
-                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-            }
-        }
-        b = pa.getBundles("ServiceInterfaceV2", null)[0];
-        packages = pa.getExportedPackages(b);
-        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
-        for (ExportedPackage p : packages) {
-            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-        }
-
-        osgi.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
-
-        // Check that the two services are provided.
-        ServiceReference[] refs = context.getAllServiceReferences(MyService.class.getName(), null);
-        Assert.assertNotNull(refs);
-        Assert.assertEquals(2, refs.length);
-
-        ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "mycons");
-        Assert.assertNotNull(refv1);
-        Architecture arch = (Architecture) osgi.getServiceObject(refv1);
-
-        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
-        Assert.assertNotNull(desc);
-
-        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
-        Assert.assertNotNull(d.getDependencies());
-        Assert.assertEquals(1, d.getDependencies().length);
-
-        DependencyDescription dep = d.getDependencies()[0];
-        Assert.assertEquals(Dependency.RESOLVED, dep.getState());
-
-        Assert.assertEquals(1, dep.getServiceReferences().size());
-        ServiceReference r = (ServiceReference) dep.getServiceReferences().get(0);
-        Assert.assertEquals("provider", r.getProperty("factory.name"));
-        Assert.assertEquals("2.0", r.getProperty("factory.version"));
-    }
-
-    @Test
-    public void deployBundlesAtRuntimeV1() throws MalformedURLException, BundleException, InvalidSyntaxException {
-
-       Bundle b1 = context.installBundle(context.getProperty("url1"));
-       b1.start();
-
-
-       Bundle b3 = context.installBundle(context.getProperty("c1"));
-       b3.start();
-
-        Bundle b2 = context.installBundle(context.getProperty("url2"));
-        b2.start();
-
-        Bundle b4 = context.installBundle(context.getProperty("c2"));
-        b4.start();
-
-        Bundle b5 = context.installBundle(context.getProperty("consV1"));
-        b5.start();
-
-
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            System.out.println("bundle " + bundles[i].getSymbolicName() + " : " + (bundles[i].getState() == Bundle.ACTIVE));
-            //Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
-        }
-
-
-        PackageAdmin pa = osgi.getPackageAdmin();
-        Bundle b = pa.getBundles("ServiceInterfaceV1", null)[0];
-        ExportedPackage[] packages = pa.getExportedPackages(b);
-        if (packages == null) {
-            System.out.println("Packages  ServiceInterfaceV1 : " + 0);
-        } else {
-            System.out.println("Packages  ServiceInterfaceV1 : " + packages.length);
-            for (ExportedPackage p : packages) {
-                System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-            }
-        }
-        b = pa.getBundles("ServiceInterfaceV2", null)[0];
-        packages = pa.getExportedPackages(b);
-        System.out.println("Packages  ServiceInterfaceV2 : " + packages.length);
-        for (ExportedPackage p : packages) {
-            System.out.println("Package : " + p.getName() + " - " + p.getVersion().toString());
-        }
-
-        osgi.waitForService(Architecture.class.getName(), "(architecture.instance=mycons)", 2000);
-
-        // Check that the two services are provided.
-        ServiceReference[] refs = context.getAllServiceReferences(MyService.class.getName(), null);
-        Assert.assertNotNull(refs);
-        Assert.assertEquals(2, refs.length);
-
-        ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "mycons");
-        Assert.assertNotNull(refv1);
-        Architecture arch = (Architecture) osgi.getServiceObject(refv1);
-
-        HandlerDescription desc = arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
-        Assert.assertNotNull(desc);
-
-        DependencyHandlerDescription d = (DependencyHandlerDescription) desc;
-        Assert.assertNotNull(d.getDependencies());
-        Assert.assertEquals(1, d.getDependencies().length);
-
-        DependencyDescription dep = d.getDependencies()[0];
-        Assert.assertEquals(Dependency.RESOLVED, dep.getState());
-
-        Assert.assertEquals(1, dep.getServiceReferences().size());
-        ServiceReference r = (ServiceReference) dep.getServiceReferences().get(0);
-
-        Assert.assertEquals("provider", r.getProperty("factory.name"));
-        Assert.assertEquals("1.0", r.getProperty("factory.version"));
-    }
-
-
-
-
-
-
-}
diff --git a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java b/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
deleted file mode 100644
index 71fcc94..0000000
--- a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.MyService;
-
-public class MyComponent implements MyService {
-
-    public void foo() {
-        // Nothing to do.
-    }
-
-}
diff --git a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyCons.java b/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyCons.java
deleted file mode 100644
index e15d422..0000000
--- a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/component/MyCons.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.MyService;
-
-public class MyCons {
-
-    private MyService[] services;
-
-    public MyCons() {
-        System.out.println("Bound to " + services.length);
-    }
-
-}
diff --git a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java b/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
deleted file mode 100644
index 9ffaa52..0000000
--- a/ipojo/tests/core/factory-version/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.tests.core.service;
-
-public interface MyService {
-
-    public void foo();
-
-}
diff --git a/ipojo/tests/core/factory-version/vprovider-v1.xml b/ipojo/tests/core/factory-version/vprovider-v1.xml
deleted file mode 100644
index 9aee6b7..0000000
--- a/ipojo/tests/core/factory-version/vprovider-v1.xml
+++ /dev/null
@@ -1,8 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<component name="provider" classname="org.apache.felix.ipojo.tests.core.component.MyComponent" version="1.0">
-		<provides/>
-	</component>
-	<instance component="provider" version="1.0"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/factory-version/vprovider-v2.xml b/ipojo/tests/core/factory-version/vprovider-v2.xml
deleted file mode 100644
index 676764d..0000000
--- a/ipojo/tests/core/factory-version/vprovider-v2.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	<component name="provider" classname="org.apache.felix.ipojo.tests.core.component.MyComponent" version="2.0">
-		<provides/>
-	</component>
-	<instance component="provider" version="2.0"/>
-
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/core/handler/pom.xml b/ipojo/tests/core/handler/pom.xml
deleted file mode 100644
index d81c04d..0000000
--- a/ipojo/tests/core/handler/pom.xml
+++ /dev/null
@@ -1,157 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.core.handler</artifactId>
-  <name>iPOJO Handler Mechanism Test Suite</name>
-  <version>${ipojo.core.snapshot}</version>
-  <description>Test the handler mechanism</description>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-
-  <!-- Pax Exam API: -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <!--
-      During runtime Pax Exam will discover the OSGi container to use by
-      searching metadata available into classpath. Pax Exam comes with a
-      default container that uses [Pax Runner] for implementing the
-      container requirements:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-default
-          </artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <!--
-      If your test code is based on JUnit you will have to have the Junit
-      support artifact:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.5</version>
-      <type>jar</type>
-      <scope>test</scope>
-    </dependency>
-
-    <!--  TinyBundle -->
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-tinybundles</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.base</groupId>
-      <artifactId>ops4j-base</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-bnd</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-
-    <!-- mockito -->
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-all</artifactId>
-      <version>1.7</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>tinybundles-ipojo</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>osgi-helpers</artifactId>
-    </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-</project>
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/DummyHandlerTest.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/DummyHandlerTest.java
deleted file mode 100644
index 63d0c8d..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/DummyHandlerTest.java
+++ /dev/null
@@ -1,238 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.mockito.Mockito.mock;
-import static org.mockito.Mockito.verify;
-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.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-
-import java.io.File;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.tests.core.component.DummyImpl;
-import org.apache.felix.ipojo.tests.core.handler.DummyHandler;
-import org.apache.felix.ipojo.tests.core.service.Dummy;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.Mockito;
-import org.ops4j.pax.exam.CoreOptions;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.OptionUtils;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.exam.junit.JUnitOptions;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-import org.osgi.service.useradmin.User;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-import aQute.lib.osgi.Constants;
-
-@RunWith(JUnit4TestRunner.class)
-public class DummyHandlerTest {
-
-    private static final String DUMMY_TEST_FACTORY = "dummy.test";
-
-    /*
-     * Number of mock object by test.
-     */
-    private static final int NB_MOCK = 10;
-
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    @Before
-    public void setUp() {
-        osgi = new OSGiHelper(context);
-    }
-
-    @After
-    public void tearDown() {
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        Option[] platform = options(CoreOptions.felix());
-
-        Option[] bundles =
-            options(
-                    provision(
-                         newBundle()
-                             .add(DummyHandler.class)
-                             .build(withiPOJO(new File("src/test/resources/dummy-handler.xml")))
-                         ),
-                     provision(
-                         newBundle()
-                             .add(Dummy.class)
-                             .add(DummyImpl.class)
-                             .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.handler.dummy.test")
-                             .build(withiPOJO(new File("src/test/resources/dummy-component.xml")))
-                         ),
-                    provision(
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.osgi.compendium").version("1.4.0")
-                            ));
-        Option[] r = OptionUtils.combine(platform, bundles);
-
-        return r;
-    }
-
-    /**
-     * iPOJO Bunles
-     * @return
-     */
-    @Configuration
-    public static Option[] configAdminBundle() {
-        return options(
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").versionAsInProject(),
-                mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject());
-    }
-
-    /**
-     * Mockito bundle
-     * @return
-     */
-    @Configuration
-    public static Option[] mockitoBundle() {
-        return options(JUnitOptions.mockitoBundles());
-    }
-
-    /**
-     * Basic Test, in order to know if the instance is correctly create.
-     */
-    @Test
-    public void testDummyTestInstance() {
-        ComponentInstance instance = null;
-
-        // Get the factory
-        Factory factory = Tools.getValidFactory(osgi, DUMMY_TEST_FACTORY);
-        Assert.assertNotNull(factory);
-
-        // Create an instance
-        try {
-            instance = factory.createComponentInstance(null);
-        } catch (UnacceptableConfiguration e) {
-            new AssertionError(e);
-        } catch (MissingHandlerException e) {
-            new AssertionError(e);
-            e.printStackTrace();
-        } catch (ConfigurationException e) {
-            new AssertionError(e);
-        }
-
-        // Must be valid now
-        Assert.assertEquals(instance.getState(), ComponentInstance.VALID);
-
-        // Stop the instance
-        instance.stop();
-        Assert.assertEquals(instance.getState(), ComponentInstance.STOPPED);
-
-        // Start the instance
-        instance.start();
-        Assert.assertEquals(instance.getState(), ComponentInstance.VALID);
-    }
-
-    /**
-     * Test if the bind and unbind methods are called when the bind service are registered after the instance creation
-     */
-    @Test
-    public void testDummyTestBindAfterStart() {
-        ComponentInstance instance = null;
-
-        // Get the factory
-        Factory factory = Tools.getValidFactory(osgi, DUMMY_TEST_FACTORY);
-
-        // Create an instance
-        try {
-            instance = factory.createComponentInstance(null);
-        } catch (UnacceptableConfiguration e) {
-        } catch (MissingHandlerException e) {
-        } catch (ConfigurationException e) {
-        }
-
-        Map<User, ServiceRegistration> registrations = new HashMap<User, ServiceRegistration>();
-
-        for (int i = 0; i < NB_MOCK; i++) {
-            User service = mock(User.class);
-            ServiceRegistration sr = context.registerService(User.class.getName(), service, null);
-            registrations.put(service, sr);
-        }
-
-        //verify that the bind method of the handler has been called
-        for (User user : registrations.keySet()) {
-                verify(user).getName();
-        }
-
-        //verify that the unbind has been called
-        for (User user : registrations.keySet()) {
-            registrations.get(user).unregister();
-            verify(user).getType();
-        }
-
-        //verify no more interaction
-        for (User user : registrations.keySet()) {
-                Mockito.verifyNoMoreInteractions(user);
-        }
-    }
-
-
-    /**
-     * Test if the bind and unbind methods when the bind services are registered before the instance creation
-     */
-    @Test
-    public void testDummyTestBindBeforeStart() {
-        ComponentInstance instance = null;
-
-        Map<User, ServiceRegistration> registrations = new HashMap<User, ServiceRegistration>();
-
-        for (int i = 0; i < NB_MOCK; i++) {
-            User service = mock(User.class);
-            ServiceRegistration sr = context.registerService(User.class.getName(), service, null);
-            registrations.put(service, sr);
-        }
-
-        // Get the factory
-        Factory factory = Tools.getValidFactory(osgi, DUMMY_TEST_FACTORY);
-
-        // Create an instance
-        try {
-            instance = factory.createComponentInstance(null);
-        } catch (UnacceptableConfiguration e) {
-        } catch (MissingHandlerException e) {
-        } catch (ConfigurationException e) {
-        }
-
-        //verify that the bind method of the handler has been called
-        for (User user : registrations.keySet()) {
-                verify(user).getName();
-        }
-
-        //verify that the unbind has been called
-        for (User user : registrations.keySet()) {
-            registrations.get(user).unregister();
-            verify(user).getType();
-        }
-
-        //verify no more interaction
-        for (User user : registrations.keySet()) {
-                Mockito.verifyNoMoreInteractions(user);
-        }
-    }
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/IgnoreCaseHandlerSelectionTest.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/IgnoreCaseHandlerSelectionTest.java
deleted file mode 100644
index d090cc7..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/IgnoreCaseHandlerSelectionTest.java
+++ /dev/null
@@ -1,175 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-
-import java.io.File;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.handler.EmptyHandler;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-/**
- * Check that the handler selection ignore case.
- * An empty handler declared with
- * name="EmPtY" and namespace="orG.apAche.feliX.iPOJO.tests.CORE.hAnDlEr"
- * is declared, and two instances using this handler are created. The test is
- * successful is the two instances are created correctly.
- * Test about Felix-1318 : Case mismatch problem of iPOJO custom handler name
- */
-@RunWith( JUnit4TestRunner.class )
-public class IgnoreCaseHandlerSelectionTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                            .set( Constants.BUNDLE_SYMBOLICNAME, "ServiceInterface" )
-                            .set( Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service" )
-                            .build( TinyBundles.withBnd() )
-                    ),
-               provision(
-                       // Components and the handler
-                        newBundle()
-                            .add(MyComponent.class) // Component Implementation
-                            .add(EmptyHandler.class) // Handler.
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"IgnoreCase")
-                            .set(Constants.IMPORT_PACKAGE,
-                                    "org.apache.felix.ipojo.tests.core.service, " +
-                                    "org.apache.felix.ipojo, " +
-                                    "org.apache.felix.ipojo.metadata")
-                            .build(withiPOJO(new File(tmp, "ignorecase.jar"), new File("src/test/resources/ignorecase.xml")))));
-        return opt;
-    }
-
-    @Test
-    public void testDeploy() {
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
-        }
-    }
-
-    /**
-     * Checks that the handler is declared and accessible.
-     */
-    @Test
-    public void testHandlerAvailability() {
-        ServiceReference[] refs = osgi.getServiceReferences(HandlerFactory.class.getName(), null);
-        for (ServiceReference ref : refs) {
-            String name = (String) ref.getProperty("handler.name");
-            String ns = (String) ref.getProperty("handler.namespace");
-            if (name != null
-                    && name.equalsIgnoreCase("EmPtY") // Check with ignore case.
-                    && ns != null
-                    && ns.equalsIgnoreCase("orG.apAche.feliX.iPOJO.tests.CORE.hAnDlEr")) { // Check with ignore case.
-                Integer state = (Integer) ref.getProperty("factory.state");
-                if (state != null) {
-                    Assert.assertEquals(Factory.VALID, state.intValue());
-                    return; // Handler found and valid.
-                } else {
-                    Assert.fail("Handler found but no state exposed");
-                }
-            }
-        }
-        Assert.fail("Handler not found");
-    }
-
-    /**
-     * Check that the instance is correctly created with "empty".
-     */
-    @Test
-    public void testCreationOfIgnoreCase1() {
-          ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "IgnoreCase-1");
-          Assert.assertNotNull(refv1);
-          Architecture arch = (Architecture) osgi.getServiceObject(refv1);
-          Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
-
-          HandlerDescription desc = arch.getInstanceDescription()
-              .getHandlerDescription("orG.apAche.feliX.iPOJO.tests.CORE.hAnDlEr:EmPtY");  // Check with the declared name.
-
-          Assert.assertNotNull(desc);
-          Assert.assertTrue(desc.isValid());
-    }
-
-    /**
-     * Check that the instance is correctly created with "eMptY".
-     */
-    @Test
-    public void testCreationOfIgnoreCase2() {
-          ServiceReference refv1 = ipojo.getServiceReferenceByName(Architecture.class.getName(), "IgnoreCase-2");
-          Assert.assertNotNull(refv1);
-          Architecture arch = (Architecture) osgi.getServiceObject(refv1);
-          Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
-
-          HandlerDescription desc = arch.getInstanceDescription()
-              .getHandlerDescription("org.apache.felix.ipojo.tests.core.handler:empty"); // Check with different case.
-          Assert.assertNotNull(desc);
-          Assert.assertTrue(desc.isValid());
-    }
-
-
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/Tools.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/Tools.java
deleted file mode 100644
index cdaa5bd..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/Tools.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import org.apache.felix.ipojo.Factory;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-public class Tools {
-
-
-    /**
-     * Get the Factory linked to the given pid
-     * @param osgi
-     * @param name
-     * @return The factory
-     */
-    public static Factory getValidFactory(final OSGiHelper osgi, final String name) {
-        // Get The Factory ServiceReference
-        ServiceReference facref = osgi.getServiceReference(Factory.class.getName(), "(&(factory.state=1)(factory.name=" + name + "))");
-        // Get the factory
-        Factory factory = (Factory) osgi.getServiceObject(facref);
-
-        return factory;
-    }
-
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/DummyImpl.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/DummyImpl.java
deleted file mode 100644
index afcaff5..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/DummyImpl.java
+++ /dev/null
@@ -1,16 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.Dummy;
-
-
-/**
- * Just a Dummy test 
- */
-public class DummyImpl implements Dummy{
-
-    private void start() {
-    }
-
-    private void stop() {
-    }    
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
deleted file mode 100644
index 71fcc94..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.MyService;
-
-public class MyComponent implements MyService {
-
-    public void foo() {
-        // Nothing to do.
-    }
-
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/DummyHandler.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/DummyHandler.java
deleted file mode 100644
index fbb886c..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/DummyHandler.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2009 OW2 Chameleon Licensed under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with the
- * License. You may obtain a copy of the License at
- * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
- * or agreed to in writing, software distributed under the License is
- * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the specific language
- * governing permissions and limitations under the License.
- */
-
-package org.apache.felix.ipojo.tests.core.handler;
-
-import java.util.Dictionary;
-
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.PrimitiveHandler;
-import org.apache.felix.ipojo.architecture.ComponentTypeDescription;
-import org.apache.felix.ipojo.metadata.Element;
-import org.osgi.service.useradmin.User;
-
-
-public class DummyHandler extends PrimitiveHandler {
-
-    public DummyHandler() {
-    }
-
-    /*------------------------------------------------------------*
-     *      Handler Specific Methods                              *
-     *------------------------------------------------------------*/
-
-    @Override
-    public void initializeComponentFactory(ComponentTypeDescription typeDesc, Element metadata) throws ConfigurationException {
-        // Initialize
-        super.initializeComponentFactory(typeDesc, metadata);
-    }
-
-    @Override
-    public void configure(Element metadata, Dictionary configuration) throws ConfigurationException {
-    }
-
-
-    private void bindUser(User user) {
-        // in order to test
-        user.getName();
-    }
-
-    private void unBindUser(User user) {
-        // in order to test
-        user.getType();
-    }
-
-    @Override
-    public void start() {
-    }
-
-    @Override
-    public void stop() {
-    }
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/EmptyHandler.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/EmptyHandler.java
deleted file mode 100644
index 2a1db72..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/handler/EmptyHandler.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.felix.ipojo.tests.core.handler;
-
-import java.util.Dictionary;
-
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.PrimitiveHandler;
-import org.apache.felix.ipojo.metadata.Element;
-
-public class EmptyHandler extends PrimitiveHandler {
-
-    @Override
-    public void configure(Element arg0, Dictionary arg1)
-            throws ConfigurationException {
-        info("Configured");
-    }
-
-    @Override
-    public void start() {
-        info("Started");
-    }
-
-    @Override
-    public void stop() {
-        info("Stopped");
-    }
-
-}
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/Dummy.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/Dummy.java
deleted file mode 100644
index 7c317d7..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/Dummy.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.apache.felix.ipojo.tests.core.service;
-
-public interface Dummy {
-}
-
diff --git a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java b/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
deleted file mode 100644
index 9ffaa52..0000000
--- a/ipojo/tests/core/handler/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.tests.core.service;
-
-public interface MyService {
-
-    public void foo();
-
-}
diff --git a/ipojo/tests/core/handler/src/test/resources/dummy-component.xml b/ipojo/tests/core/handler/src/test/resources/dummy-component.xml
deleted file mode 100644
index b926293..0000000
--- a/ipojo/tests/core/handler/src/test/resources/dummy-component.xml
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<iPOJO xmlns:dummy="org.apache.felix.ipojo.test.dummy.handler.dummyhandler">
-  <component className="org.apache.felix.ipojo.tests.core.component.DummyImpl" name="dummy.test">
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-
-    <dummy:dummy/>
-  </component>
-</iPOJO>
diff --git a/ipojo/tests/core/handler/src/test/resources/dummy-handler.xml b/ipojo/tests/core/handler/src/test/resources/dummy-handler.xml
deleted file mode 100644
index 19cc660..0000000
--- a/ipojo/tests/core/handler/src/test/resources/dummy-handler.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-  <!--
-    <iPOJO xmlns:wbp="org.apache.felix.ipojo.whiteboard"
-    xmlns:jmx="org.apache.felix.ipojo.handlers.jmx">
-  -->
-<iPOJO>
-  <!-- Declare the handler -->
-  <handler classname="org.apache.felix.ipojo.tests.core.handler.DummyHandler" name="dummy"
-    namespace="org.apache.felix.ipojo.test.dummy.handler.dummyhandler">
-
-
-    <requires optional="true" aggregate="true">
-      <callback type="bind" method="bindUser" />
-      <callback type="unbind" method="unBindUser" />
-    </requires>
-  </handler>
-</iPOJO>
diff --git a/ipojo/tests/core/handler/src/test/resources/ignorecase.xml b/ipojo/tests/core/handler/src/test/resources/ignorecase.xml
deleted file mode 100644
index 1173031..0000000
--- a/ipojo/tests/core/handler/src/test/resources/ignorecase.xml
+++ /dev/null
@@ -1,20 +0,0 @@
-<ipojo xmlns:ex="org.apache.felix.ipojo.tests.core.handler">
-
-<!--  Empty handler, name and namespace written strangely -->
-<handler
-  name="EmPtY"
-  namespace="orG.apAche.feliX.iPOJO.tests.CORE.hAnDlEr"
-  classname="org.apache.felix.ipojo.tests.core.handler.EmptyHandler">
-</handler>
-
-<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent" name="IgnoreCase-1">
-  <ex:empty/>
-</component>
-<instance component="IgnoreCase-1" name="IgnoreCase-1"/>
-
-<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent" name="IgnoreCase-2">
-  <ex:eMptY/>
-</component>
-<instance component="IgnoreCase-2" name="IgnoreCase-2"/>
-
-</ipojo>
diff --git a/ipojo/tests/core/lifecycle-callback/pom.xml b/ipojo/tests/core/lifecycle-callback/pom.xml
deleted file mode 100644
index d51650f..0000000
--- a/ipojo/tests/core/lifecycle-callback/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Lifecycle callback Test Suite</name>
-  <artifactId>tests.core.lifecycle.callback</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.lifecycle.callback.LifeCycleCallbackTest
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
deleted file mode 100644
index edffc63..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackCheckService.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.FooService;
-
-public class CallbackCheckService extends ParentClass implements CheckService {
-
-    int i = 0;
-
-    FooService fs;
-
-    public static CallbackCheckService singleton;
-
-    public static int count = 0;
-
-    private static CallbackCheckService singleton() {
-        if (singleton == null) {
-            count++;
-            singleton = new CallbackCheckService();
-        }
-        return singleton;
-    }
-
-    public static CallbackCheckService several() {
-        count++;
-        return new CallbackCheckService();
-    }
-
-    private void start() {
-        i++;
-    }
-
-    protected void stop() {
-        i++;
-    }
-
-    public boolean check() {
-        return fs.foo();
-    }
-
-    public Properties getProps() {
-        Properties p = new Properties();
-        p.put("int", new Integer(i));
-        p.put("count", new Integer(count));
-        return p;
-    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackWithErrorCheckService.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackWithErrorCheckService.java
deleted file mode 100644
index a33af51..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallbackWithErrorCheckService.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-
-public class CallbackWithErrorCheckService extends ParentClass implements CheckService {
-
-
-    public void start() {
-        throw new NullPointerException();
-    }
-
-    public void stop() {
-    }
-
-    public boolean check() {
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties p = new Properties();
-        return p;
-    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 35377c3..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
deleted file mode 100644
index f7fb580..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass {
-    
-    public void parentStart() {
-        
-    }
-    
-    public void parentStop() {
-        
-    }
-	
-	protected String[] strings;
-	
-	protected String string;
-	
-	protected int upStrings;
-	
-	protected int upString;
-	
-	public void updateStrings(String[] bb) {
-        strings = bb;
-        upStrings++;
-    }
-    
-    public void updateString(String bb) {
-        string = bb;
-        upString++;
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
deleted file mode 100644
index 0d54e5e..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/CallbackTestCase.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class CallbackTestCase extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        Properties p2 = new Properties();
-        p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
-        fooProvider.stop();
-        
-        Properties p1 = new Properties();
-        p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(getContext(), "LFCB-CallbackCheckService", p1);
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        fooProvider.dispose();
-        instance= null;
-        fooProvider = null;
-    }
-    
-    public void testCallback() {
-        // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
-        
-        // Start fooprovider
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check int property
-        Integer index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 1", index.intValue(), 1);
-        
-        assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
-        
-        fooProvider.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        
-        assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
-        
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check int property
-        index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 2 ("+index.intValue()+")", index.intValue(), 3);
-        
-        assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
-        
-        // Clean up
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        cs = null;
-        id_dep = null;
-    }
-        
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ErrorCallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ErrorCallbackTestCase.java
deleted file mode 100644
index 8625527..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ErrorCallbackTestCase.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Test the fix for FELIX-1965.
- * When a validate callback throws an exception, the service is still provided.
- */
-public class ErrorCallbackTestCase extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-    
-    public void tearDown() {
-        if (instance != null) {
-            instance.dispose();
-            instance= null;
-        }
-    }
-    
-    public void testErrorInValidateCallback() {
-        Properties p2 = new Properties();
-        p2.put("instance.name","error");
-        instance = Utils.getComponentInstance(getContext(), "LFCB-CallbackWithError", p2);
-        
-        // The service should not be provided as the start method has thrown an exception
-        ServiceReference ref = getServiceReference(CheckService.class.getName(), "(instance.name=" + instance.getInstanceName() +")");
-        assertNull(ref);
-        
-    }
-        
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
deleted file mode 100644
index c39f7ed..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSeveralFactoryTest.java
+++ /dev/null
@@ -1,120 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ImmediateCallbackSeveralFactoryTest extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        Properties p2 = new Properties();
-        p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
-        fooProvider.stop();
-        
-        Properties p1 = new Properties();
-        p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckServiceSeveral", p1);
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        fooProvider.dispose();
-        instance= null;
-        fooProvider = null;
-        CallbackCheckService.count = 0;
-    }
-    
-    public void testCallback() {
-        // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
-        
-        // Start fooprovider
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
-        // Check int property
-        Integer index = (Integer) (cs.getProps().get("int"));
-        Integer count = (Integer) (cs.getProps().get("count"));
-        assertEquals("Check int property - 1 (" + index.intValue() +")", index.intValue(), 1);
-        assertEquals("Check count property - 1 (" + count.intValue() +")", count.intValue(), 1);
-        
-        fooProvider.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        
-        assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
-        
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check int property
-        index = (Integer) (cs.getProps().get("int"));
-        count = (Integer) (cs.getProps().get("count"));
-        assertEquals("Check int property - 2 ("+index.intValue()+")", index.intValue(), 3);
-        assertEquals("Check count property - 2 ("+count.intValue()+")", count.intValue(), 1);
-        
-        assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
-        
-        // Clean up
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        cs = null;
-        id_dep = null;
-    }
-        
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
deleted file mode 100644
index 07eb5a3..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackSingletonFactoryTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ImmediateCallbackSingletonFactoryTest extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        Properties p2 = new Properties();
-        p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
-        fooProvider.stop();
-        
-        Properties p1 = new Properties();
-        p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckServiceSingleton", p1);
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        fooProvider.dispose();
-        instance= null;
-        fooProvider = null;
-        CallbackCheckService.count = 0;
-        CallbackCheckService.singleton = null;
-    }
-    
-    public void testCallback() {
-        // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
-        
-        // Start fooprovider
-        fooProvider.start();
-        
-        // Check instance validity
-       // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
-        // Check int property
-        Integer index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 1 (" + index.intValue() +")", index.intValue(), 1);
-        
-        fooProvider.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        
-        assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
-        
-        fooProvider.start();
-        
-        // Check instance validity
-       // id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check int property
-        index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 2 ("+index.intValue()+")", index.intValue(), 3);
-        
-        assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
-        
-        // Clean up
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        cs = null;
-        id_dep = null;
-    }
-        
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
deleted file mode 100644
index dae2876..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateCallbackTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ImmediateCallbackTest extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        Properties p2 = new Properties();
-        p2.put("instance.name","fooProvider");
-        fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
-        fooProvider.stop();
-        
-        Properties p1 = new Properties();
-        p1.put("instance.name","callback");
-        instance = Utils.getComponentInstance(getContext(), "LFCB-ImmediateCallbackCheckService", p1);
-        
-    }
-    
-    public void tearDown() {
-        instance.dispose();
-        fooProvider.dispose();
-        instance= null;
-        fooProvider = null;
-    }
-    
-    public void testCallback() {
-        // Check instance is invalid
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription)((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        assertEquals("Check pojo count - 1", id_dep.getCreatedObjects().length, 0);
-        
-        // Start fooprovider
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
-        // Check int property
-        Integer index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 1 (" + index.intValue() +")", index.intValue(), 1);
-        
-        fooProvider.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        
-        assertEquals("Check pojo count - 3", id_dep.getCreatedObjects().length, 1);
-        
-        fooProvider.start();
-        
-        // Check instance validity
-        //id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check service providing
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check int property
-        index = (Integer) (cs.getProps().get("int"));
-        assertEquals("Check int property - 2 ("+index.intValue()+")", index.intValue(), 3);
-        
-        assertEquals("Check pojo count - 4 ", id_dep.getCreatedObjects().length, 1);
-        
-        // Clean up
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        cs = null;
-        id_dep = null;
-    }
-        
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
deleted file mode 100644
index 4b41f25..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ImmediateLifeCycleControllerTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ImmediateLifeCycleControllerTest extends OSGiTestCase {
-    
-    private ComponentInstance under;
-    private Factory factory;
-    
-    public void setUp() {
-        factory = Utils.getFactoryByName(getContext(), "LFC-Test-Immediate");
-    }
-    
-    public void testOne() {
-        Properties props = new Properties();
-        props.put("conf", "foo");
-        props.put("instance.name","under");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);
-        
-        // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
-        assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 1", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        // Reconfigure the instance with a bad configuration
-        props.put("conf", "bar"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-        
-        // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
-        assertNull("Check service availability -2", ref);
-        
-        // Reconfigure the instance with a valid configuration
-        props.put("conf", "foo"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 2", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        under.dispose();
-    }
-    
-    public void testTwo() {        
-        Properties props = new Properties();
-        props.put("conf", "bar");
-        props.put("instance.name","under");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);    
-        
-        assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
-        
-        // The conf is incorrect, the PS must not be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
-        assertNull("Check service availability -1", ref);
-        
-        // Reconfigure the instance with a correct configuration
-        props.put("conf", "foo");
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under");
-        assertNotNull("Check service availability -2", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state ", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        under.dispose();
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java
deleted file mode 100644
index feccc8a..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/LifeCycleCallbackTest.java
+++ /dev/null
@@ -1,42 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class LifeCycleCallbackTest extends TestSuite {
-    
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Lifecycle callbacks Test Suite", bc);
-        ots.addTestSuite(CallbackTestCase.class);
-        ots.addTestSuite(ParentCallbackTestCase.class);
-        ots.addTestSuite(ImmediateCallbackTest.class);
-        ots.addTestSuite(ImmediateCallbackSingletonFactoryTest.class);
-        ots.addTestSuite(ImmediateCallbackSeveralFactoryTest.class);
-        ots.addTestSuite(ErrorCallbackTestCase.class);
-        return ots;
-    }
-
-}
-
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
deleted file mode 100644
index 94145c9..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/ParentCallbackTestCase.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ParentCallbackTestCase extends OSGiTestCase {
-	
-	ComponentInstance instance; // Instance under test
-	ComponentInstance fooProvider;
-
-	public void setUp() {
-		Properties p2 = new Properties();
-		p2.put("instance.name","fooProvider");
-		fooProvider = Utils.getComponentInstance(getContext(), "LFCB-FooProviderType-1", p2);
-		fooProvider.stop();
-		
-		Properties p1 = new Properties();
-		p1.put("instance.name","callback");
-		instance = Utils.getComponentInstance(getContext(), "LFCB-ParentCallbackCheckService", p1);
-		
-	}
-	
-	public void tearDown() {
-		instance.dispose();
-		fooProvider.dispose();
-		instance= null;
-		fooProvider = null;
-	}
-	
-	public void testCallback() {
-		// Check instance is invalid
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-		
-		// Start fooprovider
-		fooProvider.start();
-		
-		// Check instance validity
-		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id_dep.getState() == ComponentInstance.VALID);
-		
-		// Check service providing
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		
-		// Check int property		
-		assertEquals("Check pojo count - 2", id_dep.getCreatedObjects().length, 1);
-		
-		fooProvider.stop();
-		
-		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		// Check instance validity
-		//id_dep = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id_dep.getState() == ComponentInstance.VALID);
-		
-		// Check service providing
-		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		
-		// Clean up
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		cs = null;
-		id_dep = null;
-	}
-		
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java
deleted file mode 100644
index 45684ab..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java
deleted file mode 100644
index b1fdd34..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/lifecycle/callback/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lifecycle.callback.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 1196bc2..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-callback/src/main/resources/metadata.xml b/ipojo/tests/core/lifecycle-callback/src/main/resources/metadata.xml
deleted file mode 100644
index 7dd3607..0000000
--- a/ipojo/tests/core/lifecycle-callback/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,65 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="LFCB-FooProviderType-1" architecture="true">
-    <provides />
-  </component>
-  
-  <!-- Lifecycle Callback -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-    name="LFCB-CallbackCheckService" architecture="true">
-    <requires field="fs" />
-    <provides />
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-    name="LFCB-ParentCallbackCheckService" architecture="true">
-    <requires field="fs" />
-    <provides />
-    <callback transition="validate" method="parentStart" />
-    <callback transition="invalidate" method="parentStop" />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-    immediate="true" name="LFCB-ImmediateCallbackCheckService"
-    architecture="true">
-    <requires field="fs" />
-    <provides />
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-    immediate="true" name="LFCB-ImmediateCallbackCheckServiceSingleton"
-    factory-method="singleton" architecture="true">
-    <requires field="fs" />
-    <provides />
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackCheckService"
-    immediate="true" name="LFCB-ImmediateCallbackCheckServiceSeveral"
-    factory-method="several" architecture="true">
-    <requires field="fs" />
-    <provides />
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-  </component>
-  
-  <!--  Test initialization error -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CallbackWithErrorCheckService"
-    name="LFCB-CallbackWithError">
-    <provides />
-    <callback transition="validate" method="start" />
-    <callback transition="invalidate" method="stop" />
-  </component>
-</ipojo>
diff --git a/ipojo/tests/core/lifecycle-controller/pom.xml b/ipojo/tests/core/lifecycle-controller/pom.xml
deleted file mode 100644
index 734d0b6..0000000
--- a/ipojo/tests/core/lifecycle-controller/pom.xml
+++ /dev/null
@@ -1,169 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Lifecycle controller Test Suite</name>
-  <artifactId>tests.core.lifecycle.controller</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.lfc.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.lfc.LifeCycleControllerTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-              <metadata>
-                  <![CDATA[
-                <ipojo
-                      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-                     xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-                     xmlns="org.apache.felix.ipojo">
-                   <component
-                    classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
-                    name="LFC-Test">
-                    <provides />
-                    <controller field="m_state" />
-                    <properties>
-                      <property name="conf" field="m_conf" method="setConf" />
-                    </properties>
-                   </component>
-
-                     <component
-                    classname="org.apache.felix.ipojo.test.scenarios.component.LifecycleControllerTest"
-                    name="LFC-Test-Immediate" immediate="true" architecture="true">
-                    <provides />
-                    <controller field="m_state" />
-                    <properties>
-                      <property name="conf" field="m_conf" method="setConf" />
-                    </properties>
-                   </component>
-
-                   <component
-                    classname="org.apache.felix.ipojo.test.scenarios.component.ConfigurableLifecycleControllerTest"
-                    name="LFC-Test-Configurable" architecture="true">
-                    <provides />
-                    <!-- The property and the controller share the same field -->
-                    <controller field="m_state" />
-                    <properties>
-                      <property name="state" field="m_state" />
-                    </properties>
-                   </component>
-                 </ipojo>
-                 ]]>
-              </metadata>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-      <plugin>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>maven-junit4osgi-plugin
-          </artifactId>
-          <version>1.1.0-SNAPSHOT</version>
-          <executions>
-            <execution>
-              <goals>
-                <goal>test</goal>
-              </goals>
-              <configuration>
-                <logService>false</logService>
-                <configuration>
-                <org.osgi.http.port>8083</org.osgi.http.port>
-                </configuration>
-              </configuration>
-            </execution>
-          </executions>
-          </plugin>
-    </plugins>
-  </build>
-</project>
\ No newline at end of file
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableLifecycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableLifecycleControllerTest.java
deleted file mode 100644
index 05d2cdf..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ConfigurableLifecycleControllerTest.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
-
-public class ConfigurableLifecycleControllerTest implements CheckService {
-
-	// This is both a property and the controller.
-    private boolean m_state;
-
-    public boolean check() {
-        return m_state;
-    }
-
-    public Properties getProps() {
-       Properties props = new Properties();
-       props.put("state", new Boolean(m_state));
-       return props;
-    }
-
-}
-
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
deleted file mode 100644
index 9027ed1..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/component/LifecycleControllerTest.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
-
-public class LifecycleControllerTest implements CheckService {
-    
-    private boolean m_state = true;
-    private String m_conf;
-    
-    public void setConf(String newConf) {
-        if (newConf.equals("foo")) {
-            m_state = true;
-        } else {
-            m_state = false;
-        }
-    }
-
-    public boolean check() {
-        return m_state;
-    }
-
-    public Properties getProps() {
-       Properties props = new Properties();
-       props.put("conf", m_conf);
-       props.put("state", new Boolean(m_state));
-       return props;
-    }
-}
-
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ConfigurableLifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ConfigurableLifeCycleControllerTest.java
deleted file mode 100644
index d70dbae..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ConfigurableLifeCycleControllerTest.java
+++ /dev/null
@@ -1,197 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lfc;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class ConfigurableLifeCycleControllerTest extends OSGiTestCase {
-
-    private ComponentInstance under;
-
-    private Factory factory;
-
-    public void setUp() {
-        factory = Utils.getFactoryByName(getContext(), "LFC-Test-Configurable");
-    }
-
-    public void testValidThenInvalid() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties props = new Properties();
-        props.put("instance.name","under1");
-        props.put("state", "true");
-        under = factory.createComponentInstance(props);
-
-        // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 1", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        // Reconfigure the instance
-        props.put("state", "false"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-
-        // The instance should now be invalid
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNull("Check service availability -2", ref);
-
-        // Reconfigure the instance with a valid configuration
-        props.put("state", "true");
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
-        }
-
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 2", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        under.dispose();
-    }
-
-    public void testInValidThenValid() throws Exception {
-        Properties props = new Properties();
-        props.put("instance.name","under1");
-        props.put("state", "false");
-        under = factory.createComponentInstance(props);
-
-        // The instance should now be invalid
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNull("Check service availability -2", ref);
-
-        // Reconfigure the instance
-        props.put("state", "true"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-
-//        Object[] objects = Utils.getServiceObjects(context, Architecture.class.getName(), null);
-//        for (int i = 0; i < objects.length; i++) {
-//        	Architecture a = (Architecture) objects[i];
-//        	System.out.println(a.getInstanceDescription().getDescription());
-//        }
-
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 1", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        // Reconfigure the instance
-        props.put("state", "false"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-
-        // The instance should now be invalid
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNull("Check service availability -2", ref);
-
-        // Reconfigure the instance with a valid configuration
-        props.put("state", "true");
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
-        }
-
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 2", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        under.dispose();
-    }
-
-//    /**
-//     * This test must be removed as it is not compliant with OSGi. It unregisters a service during the creation of the
-//     * service instance, so the returned object is null.
-//     */
-//    public void notestTwo() {
-//        Properties props = new Properties();
-//        props.put("conf", "bar");
-//        props.put("instance.name","under2");
-//        under = Utils.getComponentInstance(getContext(), "LFC-Test", props);
-//
-//        // The conf is incorrect, but the test can appears only when the object is created : the PS must be provided
-//        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-//        assertNotNull("Check service availability -1", ref);
-//
-//        System.out.println("CS received : " + getContext().getService(ref));
-//        CheckService cs = (CheckService) getContext().getService(ref);
-//        assertNotNull("Assert CS not null", cs);
-//        try {
-//            assertFalse("Check state (false)", cs.check());
-//        } catch (Throwable e) {
-//            e.printStackTrace();
-//            fail(e.getMessage());
-//        }
-//
-//        // As soon as the instance is created, the service has to disappear :
-//        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-//        assertNull("Check service availability -2", ref);
-//
-//        // Reconfigure the instance with a correct configuration
-//        props.put("conf", "foo");
-//        try {
-//            factory.reconfigure(props);
-//        } catch (Exception e) {
-//            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-//        }
-//
-//        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-//        assertNotNull("Check service availability -3", ref);
-//        cs = (CheckService) getContext().getService(ref);
-//        assertTrue("Check state ", cs.check());
-//        getContext().ungetService(ref);
-//        cs = null;
-//
-//        under.dispose();
-//    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
deleted file mode 100644
index 4b86fb0..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/ImmediateLifeCycleControllerTest.java
+++ /dev/null
@@ -1,115 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lfc;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ImmediateLifeCycleControllerTest extends OSGiTestCase {
-    
-    private ComponentInstance under;
-    private Factory factory;
-    
-    public void setUp() {
-        factory = Utils.getFactoryByName(getContext(), "LFC-Test-Immediate");
-    }
-    
-    public void testOne() {
-        Properties props = new Properties();
-        props.put("conf", "foo");
-        props.put("instance.name","under1");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);
-        
-        // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 1", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        // Reconfigure the instance with a bad configuration
-        props.put("conf", "bar"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-        
-        // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNull("Check service availability -2", ref);
-        
-        // Reconfigure the instance with a valid configuration
-        props.put("conf", "foo"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 2", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        under.dispose();
-    }
-    
-    public void testTwo() {        
-        Properties props = new Properties();
-        props.put("conf", "bar");
-        props.put("instance.name","under2");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test-Immediate", props);    
-        
-        assertEquals("check under state", under.getState(), ComponentInstance.INVALID);
-        
-        // The conf is incorrect, the PS must not be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-        assertNull("Check service availability -1", ref);
-        
-        // Reconfigure the instance with a correct configuration
-        props.put("conf", "foo");
-        try {
-            factory.reconfigure(props);
-        } catch(Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-        
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-        assertNotNull("Check service availability -2", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state ", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-        
-        under.dispose();
-    }
-    
-    
-
-}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
deleted file mode 100644
index 597b21a..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTest.java
+++ /dev/null
@@ -1,133 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lfc;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.lfc.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class LifeCycleControllerTest extends OSGiTestCase {
-
-    private ComponentInstance under;
-
-    private Factory factory;
-
-    public void setUp() {
-        factory = Utils.getFactoryByName(getContext(), "LFC-Test");
-    }
-
-    public void testOne() {
-        Properties props = new Properties();
-        props.put("conf", "foo");
-        props.put("instance.name","under1");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test", props);
-
-        // The conf is correct, the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -1", ref);
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 1", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        // Reconfigure the instance with a bad configuration
-        props.put("conf", "bar"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-
-        // The instance should now be invalid 
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNull("Check service availability -2", ref);
-
-        // Reconfigure the instance with a valid configuration
-        props.put("conf", "foo"); // Bar is a bad conf
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable (2) : " + props);
-        }
-
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under1");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state 2", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        under.dispose();
-    }
-
-    /**
-     * This test must be removed as it is not compliant with OSGi. It unregisters a service during the creation of the 
-     * service instance, so the returned object is null. 
-     */
-    public void notestTwo() {
-        Properties props = new Properties();
-        props.put("conf", "bar");
-        props.put("instance.name","under2");
-        under = Utils.getComponentInstance(getContext(), "LFC-Test", props);
-
-        // The conf is incorrect, but the test can appears only when the object is created : the PS must be provided
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-        assertNotNull("Check service availability -1", ref);
-
-        System.out.println("CS received : " + getContext().getService(ref));
-        CheckService cs = (CheckService) getContext().getService(ref);
-        assertNotNull("Assert CS not null", cs);
-        try {
-            assertFalse("Check state (false)", cs.check());
-        } catch (Throwable e) {
-            e.printStackTrace();
-            fail(e.getMessage());
-        }
-
-        // As soon as the instance is created, the service has to disappear :
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-        assertNull("Check service availability -2", ref);
-
-        // Reconfigure the instance with a correct configuration
-        props.put("conf", "foo");
-        try {
-            factory.reconfigure(props);
-        } catch (Exception e) {
-            fail("The reconfiguration is not unacceptable and seems unacceptable : " + props);
-        }
-
-        ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), "under2");
-        assertNotNull("Check service availability -3", ref);
-        cs = (CheckService) getContext().getService(ref);
-        assertTrue("Check state ", cs.check());
-        getContext().ungetService(ref);
-        cs = null;
-
-        under.dispose();
-    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java
deleted file mode 100644
index 80ce329..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/LifeCycleControllerTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lfc;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class LifeCycleControllerTestSuite {
-
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Lifecycle Controller Test Suite", bc);
-        ots.addTestSuite( LifeCycleControllerTest.class);
-        ots.addTestSuite( ImmediateLifeCycleControllerTest.class);
-        ots.addTestSuite(ConfigurableLifeCycleControllerTest.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java
deleted file mode 100644
index 3741060..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/lfc/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.lfc.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 055b9bd..0000000
--- a/ipojo/tests/core/lifecycle-controller/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,326 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-//import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/logger/component.xml b/ipojo/tests/core/logger/component.xml
deleted file mode 100644
index b30dab9..0000000
--- a/ipojo/tests/core/logger/component.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<ipojo>
-<component classname="org.apache.felix.ipojo.tests.core.component.MyComponent">
-  <provides/>
-</component>
-<instance component="org.apache.felix.ipojo.tests.core.component.MyComponent"/>
-</ipojo>
diff --git a/ipojo/tests/core/logger/erroneous-component.xml b/ipojo/tests/core/logger/erroneous-component.xml
deleted file mode 100644
index 9ac7735..0000000
--- a/ipojo/tests/core/logger/erroneous-component.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<ipojo>
-<component immediate="true" classname="org.apache.felix.ipojo.tests.core.component.MyErroneousComponent">
-  <provides/>
-</component>
-</ipojo>
diff --git a/ipojo/tests/core/logger/pom.xml b/ipojo/tests/core/logger/pom.xml
deleted file mode 100644
index 9b5925d..0000000
--- a/ipojo/tests/core/logger/pom.xml
+++ /dev/null
@@ -1,144 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.core.logger</artifactId>
-  <name>iPOJO Logger Test Suite</name>
-  <version>${ipojo.core.snapshot}</version>
-  <description>Test the logger configuration</description>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-  <dependency>
-    <groupId>org.osgi</groupId>
-    <artifactId>org.osgi.core</artifactId>
-  </dependency>
-  <dependency>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>org.apache.felix.ipojo</artifactId>
-    <version>${ipojo.core.snapshot}</version>
-  </dependency>
-  <dependency>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>org.apache.felix.log</artifactId>
-    <version>1.0.0</version>
-  </dependency>
-
-  <!--
-    Pax Exam API:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <!--
-    During runtime Pax Exam will discover the OSGi container to use by
-    searching metadata available into classpath. Pax Exam comes with a
-    default container that uses [Pax Runner] for implementing the
-    container requirements:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-container-default
-    </artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <!--
-    If your test code is based on JUnit you will have to have the Junit
-    support artifact:
-  -->
-  <dependency>
-    <groupId>org.ops4j.pax.exam</groupId>
-    <artifactId>pax-exam-junit</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-  <dependency>
-    <groupId>junit</groupId>
-    <artifactId>junit</artifactId>
-    <version>4.5</version>
-    <type>jar</type>
-    <scope>test</scope>
-  </dependency>
-  <!--  Tinybundles -->
-  <dependency>
-    <groupId>org.ops4j.pax.swissbox</groupId>
-    <artifactId>pax-swissbox-tinybundles</artifactId>
-    <version>1.2.0</version>
-  </dependency>
-
-  <dependency>
-    <groupId>org.ow2.chameleon.testing</groupId>
-    <artifactId>tinybundles-ipojo</artifactId>
-  </dependency>
-  <dependency>
-    <groupId>org.ow2.chameleon.testing</groupId>
-    <artifactId>osgi-helpers</artifactId>
-  </dependency>
-</dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-</project>
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/BNDManifestLoggerInfoTest.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/BNDManifestLoggerInfoTest.java
deleted file mode 100644
index 2b706cd..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/BNDManifestLoggerInfoTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class BNDManifestLoggerInfoTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    private LogReaderService log;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-
-        log = (LogReaderService) osgi.getServiceObject(LogReaderService.class.getName(), null);
-        if (log == null) {
-            throw new RuntimeException("No Log Service !");
-        }
-
-        LogService logs = (LogService) osgi.getServiceObject(LogService.class.getName(), null);
-        logs.log(LogService.LOG_WARNING, "Ready");
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-               // knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withBnd() )
-                    ),
-               provision(
-                       // Component
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"MyComponent")
-                            .set(Constants.IMPORT_PACKAGE, "*")
-                            .set("IPOJO-log-level", "info")
-                            .build( withiPOJO(new File(tmp, "provider-with-level-in-manifest.jar"), new File("component.xml")))
-                            )
-                );
-        return opt;
-    }
-
-    @Test
-    public void testMessages() throws InterruptedException {
-        List<String> messages = getMessages(log.getLog());
-        Assert.assertTrue(messages.contains("Ready"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : Instance org.apache.felix.ipojo.tests.core.component.MyComponent-0 from factory org.apache.felix.ipojo.tests.core.component.MyComponent created"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : New factory created : org.apache.felix.ipojo.tests.core.component.MyComponent"));
-    }
-
-   private List<String> getMessages(Enumeration<LogEntry> log2) {
-       List<String> list = new ArrayList<String>();
-       while (log2.hasMoreElements()) {
-           LogEntry entry = (LogEntry) log2.nextElement();
-           list.add(entry.getMessage());
-       }
-       return list;
-    }
-
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ErrorHandlerTest.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ErrorHandlerTest.java
deleted file mode 100644
index 1e0f7d6..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ErrorHandlerTest.java
+++ /dev/null
@@ -1,160 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ErrorHandler;
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.component.MyErroneousComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class ErrorHandlerTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-//                equinox(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build()
-                    ),
-               provision(
-                       // Component
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"MyComponent")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .set("Ipojo-log-level", "info")
-                            .build( withiPOJO(new File(tmp, "provider-with-level-in-manifest.jar"), new File("component.xml")))
-                            ),
-                provision(
-                        // Component
-                         newBundle()
-                             .add(MyErroneousComponent.class)
-                             .set(Constants.BUNDLE_SYMBOLICNAME,"MyErroneousComponent")
-                             .set("Ipojo-log-level", "debug")
-                             .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                             .build( withiPOJO(new File(tmp, "erroneous-provider-with-level-in-manifest.jar"), new File("erroneous-component.xml")))
-                             )
-                );
-        return opt;
-    }
-
-    @Test
-    public void testErrorHandlerEmpty() throws InterruptedException, InvalidSyntaxException {
-    	MyErrorHandler handler = new MyErrorHandler();
-    	context.registerService(ErrorHandler.class.getName(), handler, null);
-
-        System.out.println(handler.m_errors);
-
-        Assert.assertTrue(handler.m_errors.isEmpty());
-    }
-
-    @Test
-    public void testErrorHandler() throws InterruptedException, InvalidSyntaxException {
-    	MyErrorHandler handler = new MyErrorHandler();
-    	context.registerService(ErrorHandler.class.getName(), handler, null);
-
-    	try {
-    		ipojo.createComponentInstance("org.apache.felix.ipojo.tests.core.component.MyErroneousComponent");
-    	} catch (Exception e ) {
-    		System.out.println(e);
-    	}
-
-
-        System.out.println(handler.m_errors);
-
-        Assert.assertFalse(handler.m_errors.isEmpty());
-        Assert.assertTrue(handler.m_errors.contains("org.apache.felix.ipojo.tests.core.component.MyErroneousComponent-0:[org.apache.felix.ipojo.tests.core.component.MyErroneousComponent-0] createInstance -> Cannot invoke the constructor method - the constructor throws an exception : bad:bad"));
-    }
-
-
-   private class MyErrorHandler implements ErrorHandler {
-
-	   private List<String> m_errors = new ArrayList<String>();
-
-	   public void onError(ComponentInstance instance, String message,
-				Throwable error) {
-		   System.out.println("on Error ! " + instance + " - " + message);
-			if (instance == null) {
-				if (error == null) {
-					m_errors.add("no-instance:" + message);
-				} else {
-					m_errors.add("no-instance:" + message + ":" + error.getMessage());
-				}
-			} else {
-				if (error == null) {
-					m_errors.add(instance.getInstanceName() + ":" + message);
-				} else {
-					m_errors.add(instance.getInstanceName() + ":" + message + ":" + error.getMessage());
-				}
-			}
-		}
-
-	   public void onWarning(ComponentInstance instance, String message,
-				Throwable error) {
-		   System.out.println("on warning ! " + instance + " - " + message);
-		}
-
-   }
-
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ManifestLoggerInfoTest.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ManifestLoggerInfoTest.java
deleted file mode 100644
index 5ca7c9d..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/ManifestLoggerInfoTest.java
+++ /dev/null
@@ -1,156 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class ManifestLoggerInfoTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    private LogReaderService log;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-
-        log = (LogReaderService) osgi.getServiceObject(LogReaderService.class.getName(), null);
-        if (log == null) {
-            throw new RuntimeException("No Log Service !");
-        }
-
-        LogService logs = (LogService) osgi.getServiceObject(LogService.class.getName(), null);
-        logs.log(LogService.LOG_WARNING, "Ready");
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build()
-                    ),
-               provision(
-                       // Component
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"MyComponent")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .set("Ipojo-log-level", "info")
-                            .build( withiPOJO(new File(tmp, "provider-with-level-in-manifest.jar"), new File("component.xml")))
-                            ),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                           .build();
-                    }
-                });
-        return opt;
-    }
-
-    @Test
-    public void testMessages() throws InterruptedException, InvalidSyntaxException {
-        Bundle bundle = osgi.getBundle("MyComponent");
-        Assert.assertNotNull(bundle);
-        Assert.assertEquals(Bundle.ACTIVE, bundle.getState());
-
-        ServiceReference r = ipojo.getServiceReferenceByName(Architecture.class.getName(), "org.apache.felix.ipojo.tests.core.component.MyComponent-0");
-        Assert.assertNotNull(r);
-        System.out.println(((Architecture) osgi.getServiceObject(r)).getInstanceDescription().getDescription());
-
-        ServiceReference[] refs = context.getAllServiceReferences(null, null);
-        for (ServiceReference ref : refs) {
-            System.out.println(ref.getBundle().getBundleId() + " -> " + Arrays.asList((String[]) ref.getProperty(Constants.OBJECTCLASS)));
-        }
-
-
-
-        Assert.assertNotNull(osgi.getServiceObject(MyService.class.getName(), null));
-
-        osgi.waitForService("org.apache.felix.ipojo.tests.core.service.MyService", null, 5000);
-        List<String> messages = getMessages(log.getLog());
-        System.out.println(messages);
-        Assert.assertTrue(messages.contains("Ready"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : Instance org.apache.felix.ipojo.tests.core.component.MyComponent-0 from factory org.apache.felix.ipojo.tests.core.component.MyComponent created"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : New factory created : org.apache.felix.ipojo.tests.core.component.MyComponent"));
-    }
-
-   private List<String> getMessages(Enumeration<LogEntry> log2) {
-       List<String> list = new ArrayList<String>();
-       while (log2.hasMoreElements()) {
-           LogEntry entry = (LogEntry) log2.nextElement();
-           list.add(entry.getMessage());
-       }
-       return list;
-    }
-
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerInfoTest.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerInfoTest.java
deleted file mode 100644
index 63f2f40..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerInfoTest.java
+++ /dev/null
@@ -1,123 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.MavenUtils.asInProject;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class SystemLoggerInfoTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    private LogReaderService log;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-
-        log = (LogReaderService) osgi.getServiceObject(LogReaderService.class.getName(), null);
-        if (log == null) {
-            throw new RuntimeException("No Log Service !");
-        }
-
-        LogService logs = (LogService) osgi.getServiceObject(LogService.class.getName(), null);
-        logs.log(LogService.LOG_WARNING, "Ready");
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject(),
-                        mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject())
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withBnd() )
-                    ),
-               provision(
-                       // Component
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"MyComponent")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withiPOJO(new File(tmp, "provider.jar"), new File("component.xml")))
-                            ),
-                systemProperty( "ipojo.log.level" ).value( "info" )
-                );
-        return opt;
-    }
-
-    @Test
-    public void testMessages() throws InterruptedException {
-        List<String> messages = getMessages(log.getLog());
-        Assert.assertTrue(messages.contains("Ready"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : Instance org.apache.felix.ipojo.tests.core.component.MyComponent-0 from factory org.apache.felix.ipojo.tests.core.component.MyComponent created"));
-        Assert.assertTrue(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : New factory created : org.apache.felix.ipojo.tests.core.component.MyComponent"));
-    }
-
-   private List<String> getMessages(Enumeration<LogEntry> log2) {
-       List<String> list = new ArrayList<String>();
-       while (log2.hasMoreElements()) {
-           LogEntry entry = (LogEntry) log2.nextElement();
-           list.add(entry.getMessage());
-       }
-       return list;
-    }
-
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerWarningTest.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerWarningTest.java
deleted file mode 100644
index cc4fee6..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/SystemLoggerWarningTest.java
+++ /dev/null
@@ -1,124 +0,0 @@
-package org.apache.felix.ipojo.tests.core;
-
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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.CoreOptions.systemProperty;
-import static org.ops4j.pax.exam.MavenUtils.asInProject;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-
-import org.apache.felix.ipojo.tests.core.component.MyComponent;
-import org.apache.felix.ipojo.tests.core.service.MyService;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.service.log.LogEntry;
-import org.osgi.service.log.LogReaderService;
-import org.osgi.service.log.LogService;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class SystemLoggerWarningTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    private LogReaderService log;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-
-        log = (LogReaderService) osgi.getServiceObject(LogReaderService.class.getName(), null);
-        if (log == null) {
-            throw new RuntimeException("No Log Service !");
-        }
-
-        LogService logs = (LogService) osgi.getServiceObject(LogService.class.getName(), null);
-        logs.log(LogService.LOG_WARNING, "Ready");
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-               // equinox(),
-               // knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId( "org.apache.felix" ).artifactId( "org.apache.felix.log" ).version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        newBundle()
-                            .add( MyService.class )
-                           .set(Constants.BUNDLE_SYMBOLICNAME,"ServiceInterface")
-                           .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withBnd() )
-                    ),
-               provision(
-                       // Component
-                        newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"MyComponent")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.core.service")
-                            .build( withiPOJO(new File(tmp, "provider.jar"), new File("component.xml")))
-                            ),
-                systemProperty( "ipojo.log.level" ).value( "warning" )
-                );
-        return opt;
-    }
-
-    @Test
-    public void testMessages() throws InterruptedException {
-        List<String> messages = getMessages(log.getLog());
-        Assert.assertTrue(messages.contains("Ready"));
-        // Not logged.
-        Assert.assertFalse(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : Instance org.apache.felix.ipojo.tests.core.component.MyComponent-0 from factory org.apache.felix.ipojo.tests.core.component.MyComponent created"));
-        Assert.assertFalse(messages.contains("[INFO] org.apache.felix.ipojo.tests.core.component.MyComponent : New factory created : org.apache.felix.ipojo.tests.core.component.MyComponent"));
-    }
-
-   private List<String> getMessages(Enumeration<LogEntry> log2) {
-       List<String> list = new ArrayList<String>();
-       while (log2.hasMoreElements()) {
-           LogEntry entry = (LogEntry) log2.nextElement();
-           list.add(entry.getMessage());
-       }
-       return list;
-    }
-
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
deleted file mode 100644
index 71fcc94..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyComponent.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.MyService;
-
-public class MyComponent implements MyService {
-
-    public void foo() {
-        // Nothing to do.
-    }
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyErroneousComponent.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyErroneousComponent.java
deleted file mode 100644
index feca648..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/component/MyErroneousComponent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.tests.core.component;
-
-import org.apache.felix.ipojo.tests.core.service.MyService;
-
-public class MyErroneousComponent implements MyService {
-
-	public MyErroneousComponent() {
-		throw new NullPointerException("bad");
-	}
-
-    public void foo() {
-        // Nothing to do.
-    }
-
-}
diff --git a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java b/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
deleted file mode 100644
index 9ffaa52..0000000
--- a/ipojo/tests/core/logger/src/test/java/org/apache/felix/ipojo/tests/core/service/MyService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.tests.core.service;
-
-public interface MyService {
-
-    public void foo();
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/pom.xml b/ipojo/tests/core/service-dependency-bindingpolicy/pom.xml
deleted file mode 100644
index eff213c..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Dependency (Binding Policy) Test Suite</name>
-  <artifactId>tests.core.service.dependency.bindingpolicy</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.core.service.dependency</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority, org.apache.felix.ipojo.test.scenarios.service.dependency.policies, org.apache.felix.ipojo.test.scenarios.service.dependency.statics, org.apache.felix.ipojo.test.scenarios.util
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.policies.DependencyTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-      <!--<plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin
-        </artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <hideOutputs>false</hideOutputs>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>-->
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java
deleted file mode 100644
index 4fb517e..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/DynamicPriorityDependencyTestSuite.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class DynamicPriorityDependencyTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Dynamic-Priority Dependency Test Suite", bc);
-		ots.addTestSuite( SimpleDPDependencies.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/RankedFooProviderType1.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/RankedFooProviderType1.java
deleted file mode 100644
index 2ea33d0..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/RankedFooProviderType1.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class RankedFooProviderType1 implements FooService {	
-	private int m_grade;
-    
-    
-	public boolean foo() {
-	    m_grade = m_grade + 2;
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("grade", new Integer(m_grade));
-
-		return p;
-	}
-        
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { 
-	    return m_grade; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
deleted file mode 100644
index 97b73df..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/dynamic/priority/SimpleDPDependencies.java
+++ /dev/null
@@ -1,157 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class SimpleDPDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance3;
-	ComponentInstance fooProvider;
-    ComponentInstance fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider-1");
-			prov.put("service.ranking", "1");
-			fooProvider = Utils.getFactoryByName(getContext(), "RankedFooProviderType").createComponentInstance(prov);
-			fooProvider.stop();
-			
-			Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider-2");
-            prov2.put("service.ranking", "0");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "RankedFooProviderType").createComponentInstance(prov2);
-            fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "DPSimpleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "DPObjectCheckServiceProvider").createComponentInstance(i3);
-			
-		} catch(Exception e) { 
-		    e.printStackTrace();
-		    fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance3.dispose();
-		fooProvider.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance3 = null;
-		fooProvider = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		// Check grade
-		Integer grade = (Integer) cs.getProps().get("int");
-		assertEquals("Check first grade", 1, grade.intValue());
-		
-		fooProvider.stop(); // Turn off the best provider.
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // Check grade
-        grade = (Integer) cs.getProps().get("int");
-        assertEquals("Check second grade", 0, grade.intValue());
-        
-		fooProvider.start(); // Turn on the best provider.
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // Check grade
-        grade = (Integer) cs.getProps().get("int");
-        assertEquals("Check third grade", 1, grade.intValue());
-        
-		
-        // Increase the second provider grade.
-        ServiceReference fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check foo service (2) reference", fs_ref);
-        FooService fs = (FooService) getContext().getService(fs_ref);
-        
-        fs.foo(); // Increase the grade (now = 2)
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // Check grade
-        grade = (Integer) cs.getProps().get("int");
-        assertEquals("Check fourth grade", 2, grade.intValue());
-        
-        // Increase the other provider grade.
-        fs_ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        assertNotNull("Check foo service (1) reference", fs_ref);
-        fs = (FooService) getContext().getService(fs_ref);
-        fs.foo(); //(grade = 3)
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // Check grade
-        grade = (Integer) cs.getProps().get("int");
-        assertEquals("Check fifth grade", 3, grade.intValue());
-        		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		getContext().ungetService(fs_ref);
-		fooProvider.stop();
-		fooProvider2.stop();
-	}
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckProviderParentClass.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckProviderParentClass.java
deleted file mode 100644
index 94e2ef7..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckServiceProvider.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckServiceProvider.java
deleted file mode 100644
index 0e125d3..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DependencyTestSuite.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DependencyTestSuite.java
deleted file mode 100644
index 89c7c08..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DependencyTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority.DynamicPriorityDependencyTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.StaticDependencyTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class DependencyTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Service Dependencies (Binding Policy) Test Suite", bc);
-        ots.addTest(StaticDependencyTestSuite.suite(bc));
-        ots.addTest(DynamicPriorityDependencyTestSuite.suite(bc));
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DynCheckServiceProvider.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DynCheckServiceProvider.java
deleted file mode 100644
index a8b6310..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/DynCheckServiceProvider.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class DynCheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("int", new Integer(fs.getInt()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodCheckServiceProvider.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodCheckServiceProvider.java
deleted file mode 100644
index a09290a..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodCheckServiceProvider.java
+++ /dev/null
@@ -1,107 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import java.util.Properties;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MethodCheckServiceProvider implements CheckService {
-	
-	FooService fs;
-    
-    BundleContext context;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-	int simpleU = 0;
-	int objectU = 0;
-	int refU = 0;
-	int bothU = 0;
-	
-    
-    public MethodCheckServiceProvider(BundleContext bc) {
-        context = bc;
-    }
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-        if(fs != null) {
-            props.put("result", new Boolean(fs.foo()));
-            props.put("boolean", new Boolean(fs.getBoolean()));
-            props.put("int", new Integer(fs.getInt()));
-            props.put("long", new Long(fs.getLong()));
-            props.put("double", new Double(fs.getDouble()));
-        } else {
-            props.put("result", new Boolean(false));
-        }
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		
-		if(fs != null) {
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-        }
-		
-		return props;
-	}
-	
-	protected void objectBind(FooService o) {
-		if(o != null && o instanceof FooService) { objectB++; }
-        fs = o;
-	}
-	protected void objectUnbind(FooService o) {
-		if(o != null && o instanceof FooService) { objectU++; }
-        fs = null;
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-        fs = (FooService) context.getService(sr);
-	}
-	public void refUnbind(ServiceReference sr) {
-		if(sr != null) { refU++; }
-        context.ungetService(sr);
-        fs = null;
-	}
-	
-    protected void bothBind(FooService o, ServiceReference ref) {
-	    if(ref != null && o != null && o instanceof FooService) { bothB++; }
-	    fs = o;
-	}	
-    protected void bothUnbind(FooService o, ServiceReference ref) {
-	     if(ref != null && o != null && o instanceof FooService) { bothU++; }
-	     fs = null;
-	}
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodMultipleCheckService.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodMultipleCheckService.java
deleted file mode 100644
index db0ae19..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MethodMultipleCheckService.java
+++ /dev/null
@@ -1,154 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Properties;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MethodMultipleCheckService implements CheckService {
-
-	List fs = new ArrayList();
-	BundleContext context;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-    
-    public MethodMultipleCheckService(BundleContext bc) {
-        context = bc;
-    }
-
-	public boolean check() {
-            boolean r = fs.size() != 0;
-            for(int i = 0; i < fs.size(); i++) {
-                r = r & ((FooService) fs.get(i)).foo();
-            }
-            return r;
-	}
-	
-	private boolean getBoolean() {
-		return check();
-	}
-	
-	private int getInt() {
-		int r = 0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getInt();
-		}
-		return r;
-	}
-	
-	private long getLong() {
-		long r = 0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getLong();
-		}
-		return r;
-	}
-	
-	private double getDouble() {
-		double r = 0.0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getInt();
-		}
-		return r;
-	}
-	
-	protected Object doNothing(Object o, String s) { return null; }
-	
-//	private Object getObject() {
-//		boolean r = true;
-//		for(int i = 0; i < fs.length; i++) {
-//			r = r && ((Boolean) fs[i].getObject()).booleanValue();
-//		}
-//		return new Boolean(r);
-//	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("result", new Boolean(check()));
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-		props.put("boolean", new Boolean(getBoolean()));
-		props.put("int", new Integer(getInt()));
-		props.put("long", new Long(getLong()));
-		props.put("double", new Double(getDouble()));
-		
-		return props;
-	}
-	
-	public void objectBind(FooService o) {
-		if(o != null && o instanceof FooService) { objectB++; }
-        fs.add(o);
-	}
-	public void objectUnbind(FooService o) {
-		if(o != null && o instanceof FooService) { objectU++; }
-        fs.remove(o);
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-        fs.add(context.getService(sr));
-	}
-	public void refUnbind(ServiceReference sr) {
-		if(sr != null) { refU++; }
-        fs.remove(context.getService(sr));
-        context.ungetService(sr);
-	}
-	
-	public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            fs.add(o);
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            fs.remove(o);
-            bothU++;
-        }
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MultipleCheckService.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MultipleCheckService.java
deleted file mode 100644
index 37cb9b1..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/policies/MultipleCheckService.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.policies;
-
-import java.util.Properties;
-
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MultipleCheckService implements CheckService {
-
-    FooService fs[];
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-
-    public boolean check() {
-        boolean r = fs.length != 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r & fs[i].foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
deleted file mode 100644
index 8443197..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodOptionalDependencies.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MethodOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance3, instance4, instance5;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "StaticMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "StaticMRefOptionalCheckServiceProvider").createComponentInstance(i4);
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "StaticMBothOptionalCheckServiceProvider").createComponentInstance(i5);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void tearDown() {
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        fooProvider = null;
-    }
-
-    public void testObject() {
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
deleted file mode 100644
index 6630313..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MethodSimpleDependencies.java
+++ /dev/null
@@ -1,188 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MethodSimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance3, instance4, instance5;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "StaticMObjectCheckServiceProvider").createComponentInstance(i3);
-            assertNotNull("check instance 3", instance3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "StaticMRefCheckServiceProvider").createComponentInstance(i4);
-            assertNotNull("check instance 4", instance4);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "StaticMBothCheckServiceProvider").createComponentInstance(i5);
-            assertNotNull("check instance 5", instance5);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		fooProvider.dispose();
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		fooProvider = null;
-	}
-
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
deleted file mode 100644
index 6f64a65..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/MultipleDependencies.java
+++ /dev/null
@@ -1,313 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2, instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleMultipleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidMultipleCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "StaticRefMultipleCheckServiceProvider").createComponentInstance(i4);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-	    instance1.stop();
-	    fooProvider1.start();
-	    instance1.start();
-	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider1.stop();
-		// instance is stopped and then restarted, so bound to fooprovider 2.
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID); 
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testVoid() {
-        instance2.stop();
-        fooProvider1.start();
-        instance2.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider1.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testObject() {
-        instance3.stop();
-        fooProvider1.start();
-        instance3.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider1.stop();
-        // Instance stopped and then restarted, bound to foo provider 2.
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testRef() {
-        instance4.stop();
-        fooProvider1.start();
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider1.stop();
-        // Stop and then restarted, bound to foo provider 2.
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
deleted file mode 100644
index 842e3d4..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/OptionalDependencies.java
+++ /dev/null
@@ -1,516 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import java.util.Properties;
-
-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.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-			
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidOptionalCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "StaticRefOptionalCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "StaticBothOptionalCheckServiceProvider").createComponentInstance(i5);
-		} catch(Exception e) { fail(e.getMessage()); }		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.start();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		
-		//Check properties
-		assertFalse("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // False, the provider was not bound
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testDelayedSimple() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-	    instance1.stop();
-	    fooProvider.start();
-	    instance1.start();
-        
-	    ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, the provider was bound
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider.stop();
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID); // Dependency broken,re started with no service.
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.start();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3 ("+((Integer)props.get("voidU")) + ")", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 3", props.get("object"));
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testDelayedVoid() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        instance2.stop();
-        fooProvider.start();
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, the provider was bound
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider.stop();
-        // The instance is restarted.
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3 (" + id.getState() + ")", id.getState() == ComponentInstance.VALID); // Dependency broken and then (no service injected) restarted
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2 (" + ((Integer)props.get("objectB")).intValue() + ")", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testDelayedObject() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        instance3.stop();
-        fooProvider.start();
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, the provider was bound
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID); // Dependency broken and restarted with no service
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-	public void atestRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void atestBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3 (" + id.getState() + ")", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
deleted file mode 100644
index b3948ba..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/SimpleDependencies.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "StaticSimpleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "StaticVoidCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "StaticObjectCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "StaticRefCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "StaticBothCheckServiceProvider").createComponentInstance(i5);
-		} catch(Exception e) { 
-		    e.printStackTrace();
-		    fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		
-		fooProvider.stop();
-		// instance1 has to be stopped and restarted.
-
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-	    arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID); // The instance was invalidated and revalidated.
-		
-		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-		
-		fooProvider.stop();
-		
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		Object o = getContext().getService(cs_ref);
-		CheckService cs = (CheckService) o;
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-		fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-        
-		arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID); // The instance was revalidated.
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability - 2", cs_ref);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);		
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability - 2", cs_ref);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);     
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability - 2", cs_ref);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);     
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability - 2", cs_ref);
-        
-        fooProvider.stop();
-        
-        arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);     
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java
deleted file mode 100644
index 33d6487..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/statics/StaticDependencyTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.statics;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.MethodOptionalDependencies;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.MethodSimpleDependencies;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.MultipleDependencies;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.OptionalDependencies;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.statics.SimpleDependencies;
-import org.osgi.framework.BundleContext;
-
-public class StaticDependencyTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Static Dependency Test Suite", bc);
-		ots.addTestSuite( SimpleDependencies.class);
-		ots.addTestSuite( OptionalDependencies.class);
-		ots.addTestSuite( MultipleDependencies.class);
-		ots.addTestSuite( MethodSimpleDependencies.class);
-        ots.addTestSuite( MethodOptionalDependencies.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency-bindingpolicy/src/main/resources/metadata.xml
deleted file mode 100644
index 36f49c3..0000000
--- a/ipojo/tests/core/service-dependency-bindingpolicy/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,264 +0,0 @@
-<ipojo 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-
-	<!-- Static Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticSimpleCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static" />
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticVoidCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="voidBind" />
-			<callback type="unbind" method="voidUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticObjectCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticRefCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticBothCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMObjectCheckServiceProvider" architecture="true">
-		<requires policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMRefCheckServiceProvider" architecture="true">
-		<requires
-			specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-			policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMBothCheckServiceProvider" architecture="true">
-		<requires policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-
-	<!-- Static Simple & Optional Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticSimpleOptionalCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" optional="true" policy="static" />
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticVoidOptionalCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" optional="true" policy="static">
-			<callback type="bind" method="voidBind" />
-			<callback type="unbind" method="voidUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticObjectOptionalCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" optional="true" policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticRefOptionalCheckServiceProvider" architecture="true">
-		<requires field="fs" optional="true" policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.CheckServiceProvider"
-		name="StaticBothOptionalCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" optional="true" policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMObjectOptionalCheckServiceProvider"
-		architecture="true">
-		<requires optional="true" policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMRefOptionalCheckServiceProvider"
-		architecture="true">
-		<requires
-			specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-			optional="true" policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodCheckServiceProvider"
-		name="StaticMBothOptionalCheckServiceProvider"
-		architecture="true">
-		<requires
-			specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-			optional="true" policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<!--  Static Multiple Dependencies -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
-		name="StaticSimpleMultipleCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" policy="static" />
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
-		name="StaticVoidMultipleCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="voidBind" />
-			<callback type="unbind" method="voidUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
-		name="StaticObjectMultipleCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
-		name="StaticRefMultipleCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MultipleCheckService"
-		name="StaticBothMultipleCheckServiceProvider"
-		architecture="true">
-		<requires field="fs" policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
-		name="StaticMObjectMultipleCheckServiceProvider"
-		architecture="true">
-		<requires aggregate="true" policy="static">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
-		name="StaticMRefMultipleCheckServiceProvider"
-		architecture="true">
-		<requires
-			specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-			aggregate="true" policy="static">
-			<callback type="bind" method="refBind" />
-			<callback type="unbind" method="refUnbind" />
-		</requires>
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.MethodMultipleCheckService"
-		name="StaticMBothMultipleCheckServiceProvider"
-		architecture="true">
-		<requires aggregate="true" policy="static">
-			<callback type="bind" method="bothBind" />
-			<callback type="unbind" method="bothUnbind" />
-		</requires>
-		<provides />
-	</component>	
-	
-	<!-- Dynamic-Priority -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.dynamic.priority.RankedFooProviderType1"
-		name="RankedFooProviderType" architecture="true">
-		<provides>
-			<property field="m_grade" name="service.ranking"/>
-		</provides>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.DynCheckServiceProvider"
-		name="DPSimpleCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="dynamic-priority" />
-		<provides />
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.service.dependency.policies.DynCheckServiceProvider"
-		name="DPObjectCheckServiceProvider" architecture="true">
-		<requires field="fs" policy="dynamic-priority">
-			<callback type="bind" method="objectBind" />
-			<callback type="unbind" method="objectUnbind" />
-		</requires>
-		<provides />
-	</component>
-</ipojo>
diff --git a/ipojo/tests/core/service-dependency-comparator/pom.xml b/ipojo/tests/core/service-dependency-comparator/pom.xml
deleted file mode 100644
index 583844e..0000000
--- a/ipojo/tests/core/service-dependency-comparator/pom.xml
+++ /dev/null
@@ -1,113 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Dependency Comparator Test Suite</name>
-  <artifactId>tests.core.service.dependency.comparator</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.core.service.dependency</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.comparator,
-              org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.ComparatorTestCase
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java
deleted file mode 100644
index f5ca73a..0000000
--- a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/ComparatorTestCase.java
+++ /dev/null
@@ -1,132 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.osgi.framework.ServiceReference;
-
-public class ComparatorTestCase extends OSGiTestCase {
-    
-    String gradeFactory="COMPARATOR-gradedFooProvider";
-    String dynamic = "COMPARATOR-DynamicCheckService";
-    String dynamicpriority = "COMPARATOR-DynamicPriorityCheckService";
-    
-    
-    IPOJOHelper helper;
-    ComponentInstance dynInstance;
-    ComponentInstance dpInstance;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        dynInstance = helper.createComponentInstance(dynamic, (Properties) null);
-        dpInstance = helper.createComponentInstance(dynamicpriority, (Properties) null);
-    }
-    
-    public void tearDown() {
-       helper.dispose();
-    }
-    
-    public void testDynamic() {
-        createGrade(1);
-        ComponentInstance grade2 = createGrade(2);
-        
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), dynInstance.getInstanceName());
-        assertNotNull("CS availability", ref);
-        
-        CheckService cs = (CheckService) getServiceObject(ref);
-        Properties result = cs.getProps();
-        int fsGrade = ((Integer) result.get("fs")).intValue();
-        int fs2Grade = ((Integer) result.get("fs2")).intValue();
-        int[] fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -1", 2, fsGrade);
-        assertEquals("fs2 grade -1", 2, fs2Grade);
-        assertEquals("fss grade size -1", 2, fssGrades.length);
-        
-
-        assertEquals("fss grade[0] -1", 2, fssGrades[0]);
-        assertEquals("fss grade[1] -1", 1, fssGrades[1]);
-        
-        createGrade(3);
-        result = cs.getProps();
-        fsGrade = ((Integer) result.get("fs")).intValue();
-        fs2Grade = ((Integer) result.get("fs2")).intValue();
-        fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -2", 2, fsGrade);
-        assertEquals("fs2 grade -2", 2, fs2Grade);
-        assertEquals("fss grade size -2", 3, fssGrades.length);
-        assertEquals("fss grade[0] -2", 2, fssGrades[0]);
-        assertEquals("fss grade[1] -2", 1, fssGrades[1]);
-        assertEquals("fss grade[2] -2", 3, fssGrades[2]);
-
-        grade2.stop();
-        
-        result = cs.getProps();
-        fsGrade = ((Integer) result.get("fs")).intValue();
-        fs2Grade = ((Integer) result.get("fs2")).intValue();
-        fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -3", 3, fsGrade);
-        assertEquals("fs2 grade -3", 3, fs2Grade);
-        assertEquals("fss grade size -3", 2, fssGrades.length);
-        assertEquals("fss grade[0] -3", 1, fssGrades[0]);
-        assertEquals("fss grade[1] -3", 3, fssGrades[1]);        
-    }
-    
-    public void testDynamicPriority() {
-        createGrade(1);
-        ComponentInstance grade2 = createGrade(2);
-        
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), dpInstance.getInstanceName());
-        assertNotNull("CS availability", ref);
-        
-        CheckService cs = (CheckService) getServiceObject(ref);
-        Properties result = cs.getProps();
-        int fsGrade = ((Integer) result.get("fs")).intValue();
-        int fs2Grade = ((Integer) result.get("fs2")).intValue();
-        int[] fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -1", 2, fsGrade);
-        assertEquals("fs2 grade -1", 2, fs2Grade);
-        assertEquals("fss grade size -1", 2, fssGrades.length);
-        assertEquals("fss grade[0] -1", 2, fssGrades[0]);
-        assertEquals("fss grade[1] -1", 1, fssGrades[1]);
-        
-        createGrade(3);
-        result = cs.getProps();
-        fsGrade = ((Integer) result.get("fs")).intValue();
-        fs2Grade = ((Integer) result.get("fs2")).intValue();
-        fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -2", 3, fsGrade);
-        assertEquals("fs2 grade -2", 3, fs2Grade);
-        assertEquals("fss grade size -2", 3, fssGrades.length);
-        assertEquals("fss grade[0] -2", 3, fssGrades[0]);
-        assertEquals("fss grade[1] -2", 2, fssGrades[1]);
-        assertEquals("fss grade[2] -2", 1, fssGrades[2]);
-
-        grade2.stop();
-        
-        result = cs.getProps();
-        fsGrade = ((Integer) result.get("fs")).intValue();
-        fs2Grade = ((Integer) result.get("fs2")).intValue();
-        fssGrades = (int[]) result.get("fss");
-        
-        assertEquals("fs grade -3", 3, fsGrade);
-        assertEquals("fs2 grade -3", 3, fs2Grade);
-        assertEquals("fss grade size -3", 2, fssGrades.length);
-        assertEquals("fss grade[0] -3", 3, fssGrades[0]);
-        assertEquals("fss grade[1] -3", 1, fssGrades[1]);        
-    }
-    
-    private ComponentInstance createGrade(int grade) {
-        Properties props = new Properties();
-        props.put("grade", new Integer(grade));
-        return helper.createComponentInstance(gradeFactory, props);
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java
deleted file mode 100644
index 9881e1f..0000000
--- a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class CheckServiceProvider implements CheckService {
-    
-	FooService fs;
-	
-	FooService fs2;
-	
-	FooService[] fss;
-	
-
-	public boolean check() {    
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("fs", new Integer(fs.getInt()));
-		props.put("fs2", new Integer(fs2.getInt()));
-		
-		int[] grades = new int[fss.length];
-		
-		for (int i = 0; i < grades.length; i++) {
-            grades[i] = fss[i].getInt();
-        }
-		
-		props.put("fss", grades);
-		
-		return props;
-	}
-	
-	void bind(FooService svc) {
-		fs2 = svc;
-	}
-	
-	void unbind(FooService svc) {
-        fs2 = null;
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java
deleted file mode 100644
index c3be86b..0000000
--- a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradeComparator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;
-
-import java.util.Comparator;
-
-import org.osgi.framework.ServiceReference;
-
-public class GradeComparator implements Comparator {
-
-    public int compare(Object arg0, Object arg1) {
-        ServiceReference ref0 = null;
-        ServiceReference ref1 = null;
-        Integer grade0 = null;
-        Integer grade1 = null;
-        if (arg0 instanceof ServiceReference) {
-            ref0 = (ServiceReference)  arg0;
-            grade0 = (Integer) ref0.getProperty("grade");
-        }
-        if (arg1 instanceof ServiceReference) {
-            ref1 = (ServiceReference) arg1;
-            grade1 = (Integer) ref1.getProperty("grade");
-        }
-        
-        if (ref0 != null && ref1 != null
-                && grade0 != null && grade1 != null) {
-            return grade1.compareTo(grade0); // Best grade first.
-        } else {
-            return 0; // Equals
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java b/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java
deleted file mode 100644
index baca0ea..0000000
--- a/ipojo/tests/core/service-dependency-comparator/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/comparator/component/GradedFooServiceProvider.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class GradedFooServiceProvider implements FooService {
-    
-    
-    private int grade;
-
-    public boolean foo() {
-        return grade > 0;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return grade;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml
deleted file mode 100644
index d278fe5..0000000
--- a/ipojo/tests/core/service-dependency-comparator/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,36 +0,0 @@
-<ipojo 
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradedFooServiceProvider"
-		name="COMPARATOR-gradedFooProvider">
-		<provides>
-			<property field="grade"/>
-		</provides>
-	</component>
-	
-	
-	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.CheckServiceProvider"
-		name="COMPARATOR-DynamicCheckService">
-		<provides/>
-		<requires field="fs" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>
-		<requires field="fss" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>
-		<requires comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator">
-			<callback type="bind" method="bind"/>
-			<callback type="unbind" method="unbind"/>
-		</requires>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.CheckServiceProvider"
-		name="COMPARATOR-DynamicPriorityCheckService">
-		<provides/>
-		<requires policy="dynamic-priority" field="fs" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>
-		<requires policy="dynamic-priority" field="fss" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator"/>
-		<requires policy="dynamic-priority" comparator="org.apache.felix.ipojo.test.scenarios.service.dependency.comparator.component.GradeComparator">
-			<callback type="bind" method="bind"/>
-			<callback type="unbind" method="unbind"/>
-		</requires>
-	</component>
-	
-</ipojo>
diff --git a/ipojo/tests/core/service-dependency-filter/pom.xml b/ipojo/tests/core/service-dependency-filter/pom.xml
deleted file mode 100644
index 58fc221..0000000
--- a/ipojo/tests/core/service-dependency-filter/pom.xml
+++ /dev/null
@@ -1,130 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Dependency (Filter) Test Suite</name>
-  <artifactId>tests.core.service.dependency.filter</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>ipojo.tests</groupId>
-      <artifactId>tests.core.service.dependency</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-    <dependency>
-    <groupId>org.osgi</groupId>
-    <artifactId>org.osgi.compendium</artifactId>
-    <version>4.0.0</version>
-  </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.filter, org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component, org.apache.felix.ipojo.test.scenarios.util
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.filter.FilteredDependencyTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-
-       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FilteredDependencyTestSuite.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FilteredDependencyTestSuite.java
deleted file mode 100644
index a231caa..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FilteredDependencyTestSuite.java
+++ /dev/null
@@ -1,38 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class FilteredDependencyTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("iPOJO Filtered Service Dependency Test Suite", bc);
-		 ots.addTestSuite(SimpleFilterDependencies.class);
-	        ots.addTestSuite(OptionalSimpleFilterDependencies.class);
-	        ots.addTestSuite(MultipleFilterDependencies.class);
-	        ots.addTestSuite(OptionalMultipleFilterDependencies.class);
-	        ots.addTestSuite(FromDependencies.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java
deleted file mode 100644
index 9ddcb09..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/FromDependencies.java
+++ /dev/null
@@ -1,308 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class FromDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4;
-	ComponentInstance providerA, providerB, providerC, providerD;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","A");
-			providerA = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-			providerA.stop();
-			
-			Properties prov2 = new Properties();
-            prov2.put("instance.name","B");
-            providerB = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov2);
-            providerB.stop();
-            
-            Properties prov3 = new Properties();
-            prov3.put("service.pid", "A");
-            providerC = Utils.getFactoryByName(getContext(), "SimplePIDCheckServiceProvider").createComponentInstance(prov3);
-            providerC.stop();
-            
-            Properties prov4 = new Properties();
-            prov4.put("service.pid", "D");
-            prov4.put("instance.name","D");
-            providerD = Utils.getFactoryByName(getContext(), "SimplePIDCheckServiceProvider").createComponentInstance(prov4);
-            providerD.stop();
-		
-            // Uses the component type from value
-			Properties i1 = new Properties();
-			i1.put("instance.name","Subscriber1");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i1);
-			
-			// Uses the instance configuration from value
-			Properties i2 = new Properties();
-            i2.put("instance.name","Subscriber2");
-            Properties ii2 = new Properties();
-            ii2.put("id1", "B");
-            i2.put("requires.from", ii2);
-            instance2 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i2);
-            
-            // Uses the instance configuration from value (*)
-            Properties i3 = new Properties();
-            i3.put("instance.name","Subscriber3");
-            Properties ii3 = new Properties();
-            ii3.put("id1", "*");
-            i3.put("requires.from", ii3);
-            instance3 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i3);
-			
-            // Uses the instance configuration from value, merge filter and from
-            Properties i4 = new Properties();
-            i4.put("instance.name","Subscriber4");
-            Properties ii4 = new Properties();
-            ii4.put("id1", "D");
-            i4.put("requires.from", ii4);
-            Properties iii4 = new Properties();
-            iii4.put("id1", "(service.pid=D)");
-            i4.put("requires.filters", iii4);
-            instance4 = Utils.getFactoryByName(getContext(), "SimpleFromCheckServiceSubscriber").createComponentInstance(i4);
-		
-		} catch(Exception e) { 
-		    e.printStackTrace();
-		    fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		providerA.dispose();
-		providerB.dispose();
-		providerC.dispose();
-		providerD.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		providerA = null;
-		providerB = null;
-		providerC = null;
-		providerD = null;
-	}
-	
-	public void testFromInstanceName() {
-	    instance1.start();
-	    
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		providerB.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		providerA.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-		providerA.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-		
-		providerA.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		
-		providerA.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		providerB.stop();
-		getContext().ungetService(arch_ref);
-	}
-	
-	public void testFromPID() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        providerB.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        providerC.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        providerC.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        providerC.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        providerC.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        providerB.stop();
-        getContext().ungetService(arch_ref);
-    }
-	
-	public void testFromInstanceNameInstanceConfiguration() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        providerA.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        providerB.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        providerB.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        providerB.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        providerB.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        providerA.stop();
-        getContext().ungetService(arch_ref);
-    }
-	
-	public void testFromInstanceNameStar() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        providerA.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 0", id.getState() == ComponentInstance.VALID);
-        
-        providerB.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        providerB.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.VALID);
-        
-        providerA.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        providerB.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.VALID);
-        
-        id = null;
-        providerB.stop();
-        getContext().ungetService(arch_ref);
-    }
-	
-	public void testFromAndFilter() {
-        instance4.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        providerA.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        providerD.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        providerD.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        providerD.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        providerD.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        providerA.stop();
-        getContext().ungetService(arch_ref);
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java
deleted file mode 100644
index 71349d1..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/MultipleFilterDependencies.java
+++ /dev/null
@@ -1,581 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MultipleFilterDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider1.stop();
-            
-            prov = new Properties();
-            prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Subscriber1");
-            instance1 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Subscriber2");
-            Properties ii2 = new Properties();
-            ii2.put("id2", "(toto=A)");
-            i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
-            
-            Properties i3 = new Properties();
-            i3.put("instance.name","Subscriber3");
-            Properties ii3 = new Properties();
-            ii3.put("id1", "(toto=A)");
-            i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(getContext(), "MultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
-        
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testMultipleNotMatch() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
-        
-        
-        fooProvider2.start();
-        cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);		
-    }
-    
-    public void testMultipleMatch() {
-        
-        fooProvider1.start();
-        fooProvider2.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider2.start();
-        cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);      
-    }
-    
-    public void testMultipleNotMatchInstance() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);
-    }
-    
-    public void testMultipleMatchInstance() {
-        
-        fooProvider1.start();
-        fooProvider2.start();
-        instance3.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-       
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);        
-    }
-    
-    public void testMultipleNotMatchInstanceWithoutFilter() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 7", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 9", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);
-    }
-    
-    public void testMultipleMatchInstanceWithoutFilter() {
-        fooProvider1.start();
-        fooProvider2.start();
-        instance2.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-       
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);        
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java
deleted file mode 100644
index 3427003..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalMultipleFilterDependencies.java
+++ /dev/null
@@ -1,606 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalMultipleFilterDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider1.stop();
-            
-            prov = new Properties();
-            prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Subscriber1");
-            instance1 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Subscriber2");
-            Properties ii2 = new Properties();
-            ii2.put("id2", "(toto=A)");
-            i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber2").createComponentInstance(i2);
-            
-            Properties i3 = new Properties();
-            i3.put("instance.name","Subscriber3");
-            Properties ii3 = new Properties();
-            ii3.put("id1", "(toto=A)");
-            i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(getContext(), "OptionalMultipleFilterCheckServiceSubscriber").createComponentInstance(i3);
-        
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testMultipleNotMatch() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();  
-        
-        cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);		
-    }
-    
-    public void testMultipleMatch() {
-        
-        fooProvider1.start();
-        fooProvider2.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();
-        
-        cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);      
-    }
-    
-    public void testMultipleNotMatchInstance() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);
-    }
-    
-    public void testMultipleMatchInstance() {
-        
-        fooProvider1.start();
-        fooProvider2.start();
-        instance3.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);        
-    }
-    
-    public void testMultipleNotMatchInstanceWithoutFilter() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        fooProvider2.start();
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        CheckService cs2 = (CheckService) getContext().getService(cs_ref2);
-        // change the value of the property toto
-        cs2.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        
-        // change the value of the property toto
-        cs2.check();
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 6", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 7", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 8", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 9", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 9", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 9", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        id = null;
-        cs = null;
-        cs2 = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);   
-    }
-    
-    public void testMultipleMatchInstanceWithoutFilter() {
-
-        
-        fooProvider1.start();
-        fooProvider2.start();
-        instance2.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        
-        ServiceReference cs_ref2 = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref2);
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 1", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 2", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Array size - 3", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(0)));
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertTrue("Check Array size - 4", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(1)));
-        
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(2)));
-        assertTrue("Check Array size - 5", ((Integer)cs_instance.getProps().get("Size")).equals(new Integer(2)));
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(cs_ref2);      
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java
deleted file mode 100644
index fb13882..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/OptionalSimpleFilterDependencies.java
+++ /dev/null
@@ -1,579 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalSimpleFilterDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider1.stop();
-            
-            prov = new Properties();
-            prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Subscriber1");
-            instance1 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Subscriber2");
-            Properties ii2 = new Properties();
-            ii2.put("id2", "(toto=A)");
-            i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
-            
-            Properties i3 = new Properties();
-            i3.put("instance.name","Subscriber3");
-            Properties ii3 = new Properties();
-            ii3.put("id1", "(toto=A)");
-            i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(getContext(), "OptionalSimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
-        
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimpleNotMatch() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start(); // Registered with toto = A
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID); // Optional
-        assertTrue("Check service Binding - 7.0 (" + (Integer)cs_instance.getProps().get("Bind") +")", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check(); // Update toto to B
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3.1", id.getState() == ComponentInstance.VALID);
-        
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        assertTrue("Check service Binding - 7.1 (" + (Integer)cs_instance.getProps().get("Bind") +")", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 7", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 8", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testSimpleMatch() {
-        
-        fooProvider1.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check(); // Update toto to B
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5.1", id.getState() == ComponentInstance.VALID);
-        
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleNotMatchInstance() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 7", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 8", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleMatchInstance() {
-        
-        fooProvider1.start();
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleNotMatchInstanceWithoutFilter() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 7", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 7", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 7", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 8", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 8", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 8", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);      
-    }
-    
-    public void testSimpleMatchInstanceWithoutFilter() {
-
-        fooProvider1.start();
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 1", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 1", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 2", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 2", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 3", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 3", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 4", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 4", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 5", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(1)));
-        assertFalse("Check Nullable - 5", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 6", id.getState() == ComponentInstance.VALID);
-        assertTrue("Check service invocation", cs_instance.check());
-        assertTrue("Check service Binding - 6", ((Integer)cs_instance.getProps().get("Bind")).equals(new Integer(0)));
-        assertTrue("Check Nullable - 6", ((Boolean)cs_instance.getProps().get("Nullable")).booleanValue());
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java
deleted file mode 100644
index ebc147b..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/SimpleFilterDependencies.java
+++ /dev/null
@@ -1,514 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class SimpleFilterDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider1.stop();
-            
-            prov = new Properties();
-            prov.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceProvider").createComponentInstance(prov);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Subscriber1");
-            instance1 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Subscriber2");
-            Properties ii2 = new Properties();
-            ii2.put("id2", "(toto=A)");
-            i2.put("requires.filters", ii2);
-            instance2 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber2").createComponentInstance(i2);
-            
-            Properties i3 = new Properties();
-            i3.put("instance.name","Subscriber3");
-            Properties ii3 = new Properties();
-            ii3.put("id1", "(toto=A)");
-            i3.put("requires.filters", ii3);
-            instance3 = Utils.getFactoryByName(getContext(), "SimpleFilterCheckServiceSubscriber").createComponentInstance(i3);
-        
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimpleNotMatch() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-
-        assertTrue("Check instance invalidity - 4.1", id.getState() == ComponentInstance.INVALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        cs.check();
-        
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testSimpleMatch() {
-        
-        fooProvider1.start();
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4.1", id.getState() == ComponentInstance.INVALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        cs.check();
-        
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);        
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleNotMatchInstance() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleMatchInstance() {
-        
-        fooProvider1.start();
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleNotMatchInstanceWithoutFilter() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testSimpleMatchInstanceWithoutFilter() {
-        
-        fooProvider1.start();
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        CheckService cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("Check service invocation", cs_instance.check());
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        // change the value of the property toto
-        cs.check();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs_instance_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_instance_ref);
-        cs_instance = (CheckService) getContext().getService(cs_instance_ref);
-        assertTrue("check CheckService invocation", cs_instance.check());
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        cs_instance = null;
-        getContext().ungetService(cs_instance_ref);
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckProvider.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckProvider.java
deleted file mode 100644
index af7cc7a..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckProvider.java
+++ /dev/null
@@ -1,95 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class FilterCheckProvider implements CheckService, FooService {
-
-    private String m_toto;
-    
-    private int bind;
-    
-    private int unbind;
-    
-    public FilterCheckProvider() {
-        m_toto = "A";
-    }
-    
-    public boolean check() {
-        if (m_toto.equals("A")){
-            m_toto="B";
-            return true;
-        } else {
-            m_toto="A";
-            return false;
-        }
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("Bind", new Integer(bind-unbind));
-        return null;
-    }
-    
-    private void Bind() {
-        bind++;
-    }
-    private void Unbind() {
-        unbind++;
-    }
-
-    public boolean foo() {
-        return true;
-    }
-
-    public Properties fooProps() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public boolean getBoolean() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public double getDouble() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public int getInt() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public long getLong() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public Boolean getObject() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckSubscriber.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckSubscriber.java
deleted file mode 100644
index 5d1bc0d..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/FilterCheckSubscriber.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.Nullable;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class FilterCheckSubscriber implements CheckService {
-    
-    private FooService m_foo;
-    
-    private int bound;
-    
-    public FilterCheckSubscriber(){
-    }
-    
-    public boolean check() {
-        m_foo.foo();
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("Bind", new Integer(bound));
-        props.put("Nullable", new Boolean(m_foo instanceof Nullable));
-        return props;
-    }
-    
-    private void Bind() {
-        bound++;
-    }
-    private void Unbind() {
-        bound--;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/MultipleFilterCheckSubscriber.java b/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/MultipleFilterCheckSubscriber.java
deleted file mode 100644
index ca4b3ff..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/filter/component/MultipleFilterCheckSubscriber.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MultipleFilterCheckSubscriber implements CheckService {
-    
-    private FooService[] m_foo;
-    
-    private int binded;
-    
-    public MultipleFilterCheckSubscriber(){
-    }
-    
-    public boolean check() {
-        for (int i = 0; i < m_foo.length; i++) {
-            m_foo[i].foo();
-        }
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("Bind", new Integer(binded));
-        props.put("Size",  new Integer(m_foo.length));
-        return props;
-    }
-    
-    private void Bind() {
-        binded++;
-    }
-    private void Unbind() {
-        binded--;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml
deleted file mode 100644
index 5cdf205..0000000
--- a/ipojo/tests/core/service-dependency-filter/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo">
-
-  <!--  Simple Filter Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
-    name="SimpleFilterCheckServiceProvider" architecture="true">
-    <provides>
-      <property field="m_toto" name="toto" value="A" />
-    </provides>
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-    name="SimpleFilterCheckServiceSubscriber" architecture="true">
-    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-  
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-    name="SimpleFromCheckServiceSubscriber" architecture="true">
-    <requires field="m_foo" from="A" id="id1" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-  
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckProvider"
-    name="SimplePIDCheckServiceProvider" architecture="true">
-    <provides>
-      <property type="String" name="service.pid" />
-    </provides>
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-    name="SimpleFilterCheckServiceSubscriber2" architecture="true">
-    <requires field="m_foo" id="id2" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!--  Optional Simple Filter Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-    name="OptionalSimpleFilterCheckServiceSubscriber"
-    architecture="true">
-    <requires field="m_foo" filter="(toto=B)" id="id1"
-      optional="true" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.FilterCheckSubscriber"
-    name="OptionalSimpleFilterCheckServiceSubscriber2"
-    architecture="true">
-    <requires field="m_foo" id="id2" optional="true" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!-- Aggregate filter Dependencies-->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-    name="MultipleFilterCheckServiceSubscriber" architecture="true">
-    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-    name="MultipleFilterCheckServiceSubscriber2" architecture="true">
-    <requires field="m_foo" id="id2" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!--  Optional Aggregate Filter Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-    name="OptionalMultipleFilterCheckServiceSubscriber"
-    architecture="true">
-    <requires field="m_foo" filter="(toto=B)" id="id1" proxy="false"
-      optional="true">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.service.dependency.filter.component.MultipleFilterCheckSubscriber"
-    name="OptionalMultipleFilterCheckServiceSubscriber2"
-    architecture="true">
-    <requires field="m_foo" id="id2" optional="true" proxy="false">
-      <callback type="bind" method="Bind" />
-      <callback type="unbind" method="Unbind" />
-    </requires>
-    <provides />
-  </component>
-
-</ipojo>
diff --git a/ipojo/tests/core/service-dependency-optional/pom.xml b/ipojo/tests/core/service-dependency-optional/pom.xml
deleted file mode 100644
index 06b0536..0000000
--- a/ipojo/tests/core/service-dependency-optional/pom.xml
+++ /dev/null
@@ -1,138 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.core.dependency.optional</artifactId>
-  <name>iPOJO Optional Dependency Test Suite</name>
-  <version>${ipojo.core.snapshot}</version>
-  <description>Test the optional dependencies</description>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <!--
-    Pax Exam API:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <!--
-      During runtime Pax Exam will discover the OSGi container to use by
-      searching metadata available into classpath. Pax Exam comes with a
-      default container that uses [Pax Runner] for implementing the
-      container requirements:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-default
-    </artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <!--
-      If your test code is based on JUnit you will have to have the Junit
-      support artifact:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.5</version>
-      <type>jar</type>
-      <scope>test</scope>
-    </dependency>
-    <!--  Tinybundles -->
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-tinybundles</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>tinybundles-ipojo</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>osgi-helpers</artifactId>
-    </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-</project>
diff --git a/ipojo/tests/core/service-dependency-optional/src/main/java/org/apache/felix/ipojo/optional/MyComponent.java b/ipojo/tests/core/service-dependency-optional/src/main/java/org/apache/felix/ipojo/optional/MyComponent.java
deleted file mode 100644
index b7a13ef..0000000
--- a/ipojo/tests/core/service-dependency-optional/src/main/java/org/apache/felix/ipojo/optional/MyComponent.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.apache.felix.ipojo.optional;
-
-import org.apache.felix.ipojo.Nullable;
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.osgi.service.log.LogService;
-
-
-@Component(immediate=true, name="optional-log-cons")
-public class MyComponent {
-
-    @Requires(optional=true, proxy=false)
-    private LogService log;
-    
-    
-    public MyComponent() {
-        System.out.println("Created ! : " + (log instanceof Nullable) + " - " + log);
-        log.log(LogService.LOG_INFO, "Created !");
-        
-    }
-    
-    
-}
diff --git a/ipojo/tests/core/service-dependency-optional/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency-optional/src/main/resources/metadata.xml
deleted file mode 100644
index c8a1900..0000000
--- a/ipojo/tests/core/service-dependency-optional/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,2 +0,0 @@
-<ipojo>
-</ipojo>
diff --git a/ipojo/tests/core/service-dependency-optional/src/test/java/org/apache/felix/ipojo/test/optional/NullableTransitiveClassloadingTest.java b/ipojo/tests/core/service-dependency-optional/src/test/java/org/apache/felix/ipojo/test/optional/NullableTransitiveClassloadingTest.java
deleted file mode 100644
index 8704a3f..0000000
--- a/ipojo/tests/core/service-dependency-optional/src/test/java/org/apache/felix/ipojo/test/optional/NullableTransitiveClassloadingTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-package org.apache.felix.ipojo.test.optional;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-import static org.ops4j.pax.exam.CoreOptions.knopflerfish;
-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 static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.optional.MyComponent;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-import aQute.lib.osgi.Constants;
-
-
-/**
- * Reproduces FELIX-2093
- * iPOJO doesn't always use the correct class loader to load nullable object.
- */
-@RunWith( JUnit4TestRunner.class )
-public class NullableTransitiveClassloadingTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure()  {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                knopflerfish(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                provision(
-                        TinyBundles.newBundle()
-                            .add(MyComponent.class)
-                            .set(Constants.IMPORT_PACKAGE, "*")
-                            .build(withiPOJO(new File("src/main/resources/metadata.xml"))
-                            )
-
-                ));
-
-        return opt;
-    }
-
-    @Test
-    public void testCreation() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Factory factory = ipojo.getFactory("optional-log-cons");
-        ComponentInstance ci = factory.createComponentInstance(null);
-
-        ci.dispose();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/pom.xml b/ipojo/tests/core/service-dependency/pom.xml
deleted file mode 100644
index 6634d8b..0000000
--- a/ipojo/tests/core/service-dependency/pom.xml
+++ /dev/null
@@ -1,128 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Dependency Test Suite</name>
-  <artifactId>tests.core.service.dependency</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-        <groupId>org.osgi</groupId>
-       <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.service.dependency.DependencyTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
deleted file mode 100644
index c1328e6..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,65 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Map;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    int mapU = 0;
-    int dictU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-   public void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-        if (props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-   }
-    
-   public void propertiesMapUnbind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-   }
-   
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index c660cb6..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,145 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-    FooService fs;
-    
-    int simpleB = 0;
-    int objectB = 0;
-    int refB = 0;
-    int bothB = 0;
-    int mapB = 0;
-    int dictB = 0;
-    
-    int modified = 0;
-
-    public boolean check() {
-        return fs.foo();
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("mapB", new Integer(mapB));
-        props.put("dictB", new Integer(dictB));
-        props.put("mapU", new Integer(mapU));
-        props.put("dictU", new Integer(dictU));
-        if (fs != null) {
-            // If nullable = false and proxy, a runtime exception may be launched here
-            // catch the exception and add this to props.
-            try {
-                props.put("exception", Boolean.FALSE); // Set exception to false for checking.
-                props.put("result", new Boolean(fs.foo()));
-                props.put("boolean", new Boolean(fs.getBoolean()));
-                props.put("int", new Integer(fs.getInt()));
-                props.put("long", new Long(fs.getLong()));
-                props.put("double", new Double(fs.getDouble()));
-                if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-            } catch (RuntimeException e) {
-                props.put("exception", Boolean.TRUE);
-            }
-        }
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-        
-        
-        // Add modified
-        props.put("modified", new Integer(modified));
-        
-        return props;
-    }
-    
-    private void voidBind() {
-        simpleB++;
-    }
-    
-    public void voidModify() {
-        modified ++;
-    }
-    
-    protected void objectBind(FooService o) {
-        if (o == null) {
-            System.err.println("Bind receive null !!! ");
-            return;
-        }
-        if(o != null && o instanceof FooService) { objectB++; }
-    }
-    
-    protected void objectModify(FooService o) {
-        if (o == null) {
-            System.err.println("Bind receive null !!! [" + modified + "]");
-            return;
-        }
-        if(o != null && o instanceof FooService) { modified++; }
-    }
-    
-    public void refBind(ServiceReference sr) {
-        if(sr != null) { refB++; }
-    }
-    
-    public void refModify(ServiceReference sr) {
-        if(sr != null) { modified++; }
-    }
-    
-    public void bothBind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothB++; }
-    }
-    
-    public void bothModify(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { modified++; }
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-        fs = o;
-    }   
-    
-    protected void propertiesDictionaryModify(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { modified++; }
-        fs = o;
-    }   
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-        fs = o;
-    } 
-    
-    protected void propertiesMapModify(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { modified++; }
-        fs = o;
-    } 
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java
deleted file mode 100644
index ac465d1..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckService.java
+++ /dev/null
@@ -1,187 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Collection;
-import java.util.Dictionary;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CollectionCheckService implements CheckService {
-
-    Collection fs;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-    
-    int mapB, mapU, dictB, dictU;
-
-    public boolean check() {
-        boolean r = fs.size() != 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r & ((FooService) it.next()).foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getLong();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("mapB", new Integer(mapB));
-        props.put("mapU", new Integer(mapU));
-        props.put("dictB", new Integer(dictB));
-        props.put("dictU", new Integer(dictU));
-        
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-    }   
-    protected void propertiesMapUnbind(FooService o, Map props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-    }   
-    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
deleted file mode 100644
index d4d5b1d..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/DynCheckServiceProvider.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class DynCheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-	 int mapB, mapU, dictB, dictU;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		props.put("mapB", new Integer(mapB));
-        props.put("mapU", new Integer(mapU));
-        props.put("dictB", new Integer(dictB));
-        props.put("dictU", new Integer(dictU));
-        
-		if (fs != null) {
-		    props.put("int", new Integer(fs.getInt()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-    }   
-   
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-    }   
-    
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 8dbe98e..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,109 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
deleted file mode 100644
index d57a532..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType2.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType2 implements FooService {
-    
-    private int m_bar;  // Service property.
-    private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static int count = 0;
-    
-  
-    public boolean foo() {
-        // Update
-        if (m_foo.equals("foo")) {
-            m_foo = "bar";
-        } else {
-            m_foo = "foo";
-        }
-        return true;
-    }
-
-    public Properties fooProps() {
-        Properties p = new Properties();
-        p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-        return p;
-    }
-    
-    public boolean getBoolean() { return true; }
-
-    public double getDouble() { return 1.0; }
-
-    public int getInt() { return 1; }
-
-    public long getLong() { return 1; }
-
-    public Boolean getObject() { return new Boolean(true); }
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
deleted file mode 100644
index 6231d15..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceDefaultImpl.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class FooServiceDefaultImpl implements FooService {
-
-    public boolean foo() {
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 5;
-    }
-
-    public int getInt() {
-        return 5;
-    }
-
-    public long getLong() {
-        return 5;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
deleted file mode 100644
index 52bccb7..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ListCheckService.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class ListCheckService implements CheckService {
-
-    List fs;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-    
-    int mapB, mapU, dictB, dictU;
-
-
-    public boolean check() {
-        boolean r = fs.size() != 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r & ((FooService) fs.get(i)).foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getDouble();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        
-        props.put("mapB", new Integer(mapB));
-        props.put("mapU", new Integer(mapU));
-        props.put("dictB", new Integer(dictB));
-        props.put("dictU", new Integer(dictU));
-        
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-    }   
-    protected void propertiesMapUnbind(FooService o, Map props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-    }   
-    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
deleted file mode 100644
index d9c04a0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodCheckServiceProvider.java
+++ /dev/null
@@ -1,134 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-public class MethodCheckServiceProvider implements CheckService {
-	
-	FooService fs;
-    
-    BundleContext context;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-	int mapB = 0;
-	int dictB = 0;
-	int simpleU = 0;
-	int objectU = 0;
-	int refU = 0;
-	int bothU = 0;
-	int mapU = 0;
-	int dictU = 0;
-	
-    
-    public MethodCheckServiceProvider(BundleContext bc) {
-        context = bc;
-    }
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-        if(fs != null) {
-            props.put("result", new Boolean(fs.foo()));
-            props.put("boolean", new Boolean(fs.getBoolean()));
-            props.put("int", new Integer(fs.getInt()));
-            props.put("long", new Long(fs.getLong()));
-            props.put("double", new Double(fs.getDouble()));
-        } else {
-            props.put("result", new Boolean(false));
-        }
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-	    props.put("mapB", new Integer(mapB));
-	    props.put("dictB", new Integer(dictB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		props.put("mapU", new Integer(mapU));
-		props.put("dictU", new Integer(dictU));
-		
-		if(fs != null) {
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-        }
-		
-		return props;
-	}
-	
-	protected void objectBind(FooService o) {
-		if(o != null && o instanceof FooService) { objectB++; }
-        fs = o;
-	}
-	protected void objectUnbind(FooService o) {
-		if(o != null && o instanceof FooService) { objectU++; }
-        fs = null;
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-        fs = (FooService) context.getService(sr);
-	}
-	public void refUnbind(ServiceReference sr) {
-		if(sr != null) { refU++; }
-        context.ungetService(sr);
-        fs = null;
-	}
-	
-    protected void bothBind(FooService o, ServiceReference ref) {
-	    if(ref != null && o != null && o instanceof FooService) { bothB++; }
-	    fs = o;
-	}	
-    protected void bothUnbind(FooService o, ServiceReference ref) {
-	     if(ref != null && o != null && o instanceof FooService) { bothU++; }
-	     fs = null;
-	}
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-        fs = o;
-    }   
-    protected void propertiesMapUnbind(FooService o, Map props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-         fs = null;
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-        fs = o;
-    }   
-    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-         fs = null;
-    }
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
deleted file mode 100644
index 74115c0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MethodMultipleCheckService.java
+++ /dev/null
@@ -1,182 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.ArrayList;
-import java.util.Dictionary;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MethodMultipleCheckService implements CheckService {
-
-	List fs = new ArrayList();
-	BundleContext context;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-    
-    int mapB = 0;
-    int mapU = 0;
-    int dictB = 0, dictU=0;
-    
-    public MethodMultipleCheckService(BundleContext bc) {
-        context = bc;
-    }
-
-	public boolean check() {
-            boolean r = fs.size() != 0;
-            for(int i = 0; i < fs.size(); i++) {
-                r = r & ((FooService) fs.get(i)).foo();
-            }
-            return r;
-	}
-	
-	private boolean getBoolean() {
-		return check();
-	}
-	
-	private int getInt() {
-		int r = 0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getInt();
-		}
-		return r;
-	}
-	
-	private long getLong() {
-		long r = 0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getLong();
-		}
-		return r;
-	}
-	
-	private double getDouble() {
-		double r = 0.0;
-		for(int i = 0; i < fs.size(); i++) {
-			r = r + ((FooService) fs.get(i)).getInt();
-		}
-		return r;
-	}
-	
-	protected Object doNothing(Object o, String s) { return null; }
-	
-//	private Object getObject() {
-//		boolean r = true;
-//		for(int i = 0; i < fs.length; i++) {
-//			r = r && ((Boolean) fs[i].getObject()).booleanValue();
-//		}
-//		return new Boolean(r);
-//	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("result", new Boolean(check()));
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("mapU", new Integer(mapU));
-        props.put("mapB", new Integer(mapB));
-        props.put("dictU", new Integer(dictU));
-        props.put("dictB", new Integer(dictB));
-		props.put("boolean", new Boolean(getBoolean()));
-		props.put("int", new Integer(getInt()));
-		props.put("long", new Long(getLong()));
-		props.put("double", new Double(getDouble()));
-		
-		return props;
-	}
-	
-	public void objectBind(FooService o) {
-		if(o != null && o instanceof FooService) { objectB++; }
-        fs.add(o);
-	}
-	public void objectUnbind(FooService o) {
-		if(o != null && o instanceof FooService) { objectU++; }
-        fs.remove(o);
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-        fs.add(context.getService(sr));
-	}
-	public void refUnbind(ServiceReference sr) {
-		if(sr != null) { refU++; }
-        fs.remove(context.getService(sr));
-        context.ungetService(sr);
-	}
-	
-	public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            fs.add(o);
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            fs.remove(o);
-            bothU++;
-        }
-    }
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-        fs.add(o);
-    }   
-    protected void propertiesMapUnbind(FooService o, Map props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-         fs.remove(o);
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-        fs.add(o);
-    }   
-    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-         fs.remove(o);
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
deleted file mode 100644
index 7c64936..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
+++ /dev/null
@@ -1,184 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Dictionary;
-import java.util.Map;
-import java.util.Properties;
-
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MultipleCheckService implements CheckService {
-
-    FooService fs[];
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-    
-    int mapB, mapU, dictB, dictU;
-
-
-    public boolean check() {
-        boolean r = fs.length != 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r & fs[i].foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-        
-        props.put("mapB", new Integer(mapB));
-        props.put("mapU", new Integer(mapU));
-        props.put("dictB", new Integer(dictB));
-        props.put("dictU", new Integer(dictU));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-    
-    protected void propertiesMapBind(FooService o, Map props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapB++; }
-    }   
-    protected void propertiesMapUnbind(FooService o, Map props) {
-         if(props != null && o != null && o instanceof FooService && props.size() > 0) { mapU++; }
-    }
-    
-    protected void propertiesDictionaryBind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictB++; }
-    }   
-    protected void propertiesDictionaryUnbind(FooService o, Dictionary props) {
-        if(props != null && o != null && o instanceof FooService && props.size() > 0) { dictU++; }
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
deleted file mode 100644
index 15f7dbe..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleFilterCheckSubscriber.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class MultipleFilterCheckSubscriber implements CheckService {
-    
-    private FooService[] m_foo;
-    
-    private int binded;
-    
-    public MultipleFilterCheckSubscriber(){
-    }
-    
-    public boolean check() {
-        for (int i = 0; i < m_foo.length; i++) {
-            m_foo[i].foo();
-        }
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("Bind", new Integer(binded));
-        props.put("Size",  new Integer(m_foo.length));
-        return props;
-    }
-    
-    private void Bind() {
-        binded++;
-    }
-    private void Unbind() {
-        binded--;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
deleted file mode 100644
index f7fb580..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass {
-    
-    public void parentStart() {
-        
-    }
-    
-    public void parentStop() {
-        
-    }
-	
-	protected String[] strings;
-	
-	protected String string;
-	
-	protected int upStrings;
-	
-	protected int upString;
-	
-	public void updateStrings(String[] bb) {
-        strings = bb;
-        upStrings++;
-    }
-    
-    public void updateString(String bb) {
-        string = bb;
-        upString++;
-    }
-	
-	
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java
deleted file mode 100644
index 6b25a0c..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/RankedFooProviderType1.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class RankedFooProviderType1 implements FooService {	
-	private int m_grade;
-    
-    
-	public boolean foo() {
-	    m_grade = m_grade + 2;
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("grade", new Integer(m_grade));
-
-		return p;
-	}
-        
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { 
-	    return m_grade; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SetCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SetCheckService.java
deleted file mode 100644
index 8fbbc11..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SetCheckService.java
+++ /dev/null
@@ -1,164 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class SetCheckService implements CheckService {
-
-    Set fs;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-
-    public boolean check() {
-        boolean r = fs.size() != 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r & ((FooService) it.next()).foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        Iterator it = fs.iterator();
-        while(it.hasNext()) {
-            r = r + ((FooService) it.next()).getLong();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java
deleted file mode 100644
index 6c7011f..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/VectorCheckService.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-import java.util.Vector;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class VectorCheckService implements CheckService {
-
-    Vector fs;
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-
-    public boolean check() {
-        boolean r = fs.size() != 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r & ((FooService) fs.get(i)).foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        for (int i = 0; i < fs.size(); i++) {
-            r = r + ((FooService) fs.get(i)).getDouble();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-       // simpleB++;
-    }
-
-    public void voidUnbind() {
-       // simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-     //       objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-    //        objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C1.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C1.java
deleted file mode 100644
index a1e6f57..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C1.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.inner;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.Call;
-
-public class C1 implements Call {
-
-	public String callMe() {
-		return "called";
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C2.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C2.java
deleted file mode 100644
index b0e23ab..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C2.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.inner;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.Call;
-
-public class C2 {
-
-	private Call c1;
-
-	public String authenticate() {
-		return c1.callMe();
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C3.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C3.java
deleted file mode 100644
index c9bd632..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/C3.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.inner;
-
-public class C3 {
-
-	private C2 c2;
-
-	public MyFilter getFilter()	{
-		return new MyFilter() {
-			public String authenticate() {
-				System.out.println("My Filter ...");
-				String r = c2.authenticate();
-				System.out.println(" ... " + r);
-				return r;
-			}
-		};
-
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/MyFilter.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/MyFilter.java
deleted file mode 100644
index 2b5adc2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inner/MyFilter.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.inner;
-
-public interface MyFilter {
-
-	public String authenticate();
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java
deleted file mode 100644
index 3027fa0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/CollectionMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class CollectionMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleCollectionCheckServiceProvider").createComponentInstance(i1);
-			
-			Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalCollectionCheckServiceProvider").createComponentInstance(i2);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
deleted file mode 100644
index 4df02b9..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedMultipleDependencies.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class DelayedMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
-			instance1.stop();
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
-			instance2.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefMultipleCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-			
-	         Properties i5 = new Properties();
-	         i5.put("instance.name","Both");
-	         instance5 = Utils.getFactoryByName(getContext(), "BothMultipleCheckServiceProvider").createComponentInstance(i5);
-	         instance5.stop();
-	         
-	         Properties i6 = new Properties();
-             i6.put("instance.name","Map");
-             instance6 = Utils.getFactoryByName(getContext(), "MapMultipleCheckServiceProvider").createComponentInstance(i6);
-             instance6.stop();
-             
-             Properties i7 = new Properties();
-             i7.put("instance.name","Dict");
-             instance7 = Utils.getFactoryByName(getContext(), "DictMultipleCheckServiceProvider").createComponentInstance(i7);
-             instance7.stop();
-		
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-		} catch(Exception e) { fail(e.getMessage()); }
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		instance1.start();
-		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance1.stop();
-	}
-	
-	public void testVoid() {
-		instance2.start();
-		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-		instance2.stop();
-	}
-	
-	public void testObject() {
-		instance3.start();
-		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		instance4.stop();
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance5.stop();
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testMap() {
-	        instance6.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-	        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
-	        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-	        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-	        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-	        
-	        fooProvider1.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-	        
-	        cs = (CheckService) getContext().getService(cs_ref);
-	        props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-	        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
-	        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 1);
-	        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-	        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-	        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-	        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-	        
-	        fooProvider2.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-	        
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        instance6.stop();
-	        getContext().ungetService(cs_ref);
-	}
-	
-	public void testDict() {
-        instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 1);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance7.stop();
-        getContext().ungetService(cs_ref);
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
deleted file mode 100644
index 8a0ff11..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalDependencies.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-
-public class DelayedOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "RefOptionalCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-    }
-
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider = null;
-    }
-
-    public void testSimple() {
-        instance1.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 0.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance1.stop();
-    }
-
-    public void testVoid() {
-        instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 0.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance2.stop();
-    }
-
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance3.stop();
-    }
-
-    public void testRef() {
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-    public void testBoth() {
-        instance5.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance5.stop();
-    }
-    
-    public void testMap() {
-        instance6.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance6.stop();
-    }
-    
-    public void testDict() {
-        instance7.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance7.stop();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
deleted file mode 100644
index 518a9d8..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedOptionalMultipleDependencies.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayedOptionalMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2, instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {		
-		try {
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
-			instance1.stop();
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
-			instance2.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-		
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-		} catch(Exception e) { fail(e.getMessage()); }		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		instance1.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-		assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-		instance1.stop();
-	}
-	
-	public void testVoid() {
-		instance2.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 2);
-		assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance2.stop();
-	}
-	
-	public void testObject() {
-		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 2);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 2);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance4.stop();
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
deleted file mode 100644
index 4adf04b..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DelayedSimpleDependencies.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-public class DelayedSimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider;
-	
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
-			instance1.stop();
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidCheckServiceProvider").createComponentInstance(i2);
-			instance2.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MapCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "DictCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-		} catch(Exception e) { fail(e.getMessage()); } 
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		instance1.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		fooProvider.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		fooProvider.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		fooProvider.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance1.stop();
-	}
-	
-	public void testVoid() {
-		instance2.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	    assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	    assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance2.stop();
-	}
-	
-	public void testObject() {
-		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	    assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	    assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance4.stop();
-	}
-	
-	public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance5.stop();
-    }
-	
-	public void testMap() {
-        instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-       
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance6.stop();
-    }
-	   public void testDict() {
-	        instance7.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-	        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-	        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	       
-	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-	        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        fooProvider.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-	        
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        getContext().ungetService(cs_ref);
-	        
-	        instance7.stop();
-	    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
deleted file mode 100644
index 4130ea0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyArchitectureTest.java
+++ /dev/null
@@ -1,720 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.handlers.dependency.Dependency;
-import org.apache.felix.ipojo.handlers.dependency.DependencyDescription;
-import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
-import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DependencyArchitectureTest extends OSGiTestCase {
-    
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    ComponentInstance instance1, instance2, instance3, instance4, instance5;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider1.stop();
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","ProxiedSimple");
-            instance5 = Utils.getFactoryByName(getContext(), "ProxiedSimpleCheckServiceProvider").createComponentInstance(i5);
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i2);
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Multiple");
-            instance3 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i3);
-            
-            Properties i4 = new Properties();
-            i4.put("instance.name","OptionalMultiple");
-            instance4 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-        } catch(Exception e) {
-            throw new RuntimeException(e.getMessage());
-        }
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    private DependencyHandlerDescription getDependencyDesc(InstanceDescription id) {
-        DependencyHandlerDescription handler = (DependencyHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:requires");
-        if (handler == null) {
-            fail("Dependency Handler not found");
-            return null;
-        } else {
-            return handler;
-        }
-    }
-    
-    private DependencyDescription getDependencyDescBySpecification(
-            PrimitiveInstanceDescription id, String spec) {
-        return id.getDependency(spec);
-    }
-    
-    private ProvidedServiceHandlerDescription getPSDesc(InstanceDescription id) {
-        ProvidedServiceHandlerDescription handler = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
-        if (handler == null) {
-            fail("Provided Service Handler not found");
-            return null;
-        } else {
-            return handler;
-        }
-    }
-    
-    public void testSimpleDependency() {
-        ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_dep);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        
-        // Check dependency handler invalidity
-        DependencyHandlerDescription dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        // Check dependency metadata
-        assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
-        assertEquals("Check dependency id", dhd.getDependencies()[0].getId(), FooService.class.getName());
-        assertFalse("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
-        assertFalse("Check dependency optionality", dhd.getDependencies()[0].isOptional());
-        assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
-        assertFalse("Check dependency proxy", dhd.getDependencies()[0].isProxy());
-
-        fooProvider1.start();
-        
-        ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        fooProvider1.start();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
-        psh = getPSDesc(id_ps);
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        
-        assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph 
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        id_dep = null;
-        cs = null;
-        getContext().ungetService(arch_dep);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testProxiedSimpleDependency() {
-        ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_dep);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        
-        // Check dependency handler invalidity
-        DependencyHandlerDescription dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        // Check dependency metadata
-        assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
-        assertEquals("Check dependency id", dhd.getDependencies()[0].getId(), FooService.class.getName());
-        assertFalse("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
-        assertFalse("Check dependency optionality", dhd.getDependencies()[0].isOptional());
-        assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
-        assertTrue("Check dependency proxy", dhd.getDependencies()[0].isProxy());
-        
-        fooProvider1.start();
-        
-        ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);               
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        fooProvider1.start();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
-        psh = getPSDesc(id_ps);
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        
-        assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph 
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.INVALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        id_dep = null;
-        cs = null;
-        getContext().ungetService(arch_dep);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testOptionalDependency() {
-        ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_dep);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check dependency handler invalidity
-        DependencyHandlerDescription dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        // Check dependency metadata
-        assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
-        assertEquals("Check dependency id", dhd.getDependencies()[0].getId(), "FooService");
-        assertFalse("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
-        assertTrue("Check dependency optionality", dhd.getDependencies()[0].isOptional());
-        assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
-        
-        fooProvider1.start();
-        
-        ServiceReference arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        PrimitiveInstanceDescription id_ps = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        fooProvider1.start();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        arch_ps = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps.getState() == ComponentInstance.VALID);
-        psh = getPSDesc(id_ps);
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        
-        assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph 
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps = ((Architecture) getContext().getService(arch_ps)).getInstanceDescription();
-        psh = getPSDesc(id_ps);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        id_dep = null;
-        cs = null;
-        getContext().ungetService(arch_dep);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testMultipleDependency() {
-        ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_dep);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.INVALID);
-        
-        // Check dependency handler invalidity
-        DependencyHandlerDescription dhd = getDependencyDesc(id_dep);
-        DependencyDescription dd = getDependencyDescBySpecification(id_dep, FooService.class.getName());
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        assertTrue("Check dependency invalidity", dd.getState() == Dependency.UNRESOLVED);
-
-        
-        // Check dependency metadata
-        assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
-        assertTrue("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
-        assertFalse("Check dependency optionality", dhd.getDependencies()[0].isOptional());
-        assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
-        
-        assertEquals("Check dependency interface", dd.getSpecification(), FooService.class.getName());
-        assertTrue("Check dependency cardinality", dd.isMultiple());
-        assertFalse("Check dependency optionality", dd.isOptional());
-        assertNull("Check dependency ref -1", dd.getServiceReferences());
-        assertFalse("Check dependency proxy", dhd.getDependencies()[0].isProxy());
-
-        fooProvider1.start();
-        
-        ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        assertEquals("Check used ref - 1 (" + dhd.getDependencies()[0].getUsedServices().size() + ")", dhd.getDependencies()[0].getUsedServices().size(), 0);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 2", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        // Start a second foo service provider
-        fooProvider2.start();
-        
-        arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        assertNotNull("Check architecture 2 availability", arch_ps2);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
-        assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
-        assertEquals("Check used ref - 2 ", dhd.getDependencies()[0].getUsedServices().size(), 1); // provider 2 not already used
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        //id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
-        ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertEquals("Check POJO creation", id_ps2.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 3.1", dhd.getDependencies()[0].getUsedServices().contains(psh1.getProvidedServices()[0].getServiceReference()));
-        assertTrue("Check service reference - 3.2", dhd.getDependencies()[0].getUsedServices().contains(psh2.getProvidedServices()[0].getServiceReference()));
-        assertEquals("Check used ref - 3 ("+dhd.getDependencies()[0].getUsedServices().size()+")", dhd.getDependencies()[0].getUsedServices().size(), 2);
-        
-        fooProvider2.stop();
-        
-        arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id_ps1.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        assertEquals("Check used ref - 4 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        psh = getPSDesc(id_ps1);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        assertEquals("Check used ref - 5 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
-        
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        fooProvider2.start();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        
-        assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
-        
-        psh = getPSDesc(id_ps2);
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        
-        assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        assertEquals("Check used ref - 6 ", dhd.getDependencies()[0].getUsedServices().size(), 0);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph 
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        psh = getPSDesc(id_ps2);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        assertEquals("Check used ref - 7 ", dhd.getDependencies()[0].getUsedServices().size(), 1);
-        
-        fooProvider2.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertFalse("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertFalse("Check dependency handler invalidity", dhd.isValid());
-        
-        id_dep = null;
-        cs = null;
-        getContext().ungetService(arch_dep);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testMultipleOptionalDependency() {
-        ServiceReference arch_dep = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_dep);
-        PrimitiveInstanceDescription id_dep = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_dep.getState() == ComponentInstance.VALID);
-        
-        // Check dependency handler invalidity
-        DependencyHandlerDescription dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        // Check dependency metadata
-        assertEquals("Check dependency interface", dhd.getDependencies()[0].getInterface(), FooService.class.getName());
-        assertTrue("Check dependency cardinality", dhd.getDependencies()[0].isMultiple());
-        assertTrue("Check dependency optionality", dhd.getDependencies()[0].isOptional());
-        assertNull("Check dependency ref -1", dhd.getDependencies()[0].getServiceReferences());
-        
-        fooProvider1.start();
-        
-        ServiceReference arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        PrimitiveInstanceDescription id_ps1 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh = getPSDesc(id_ps1);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 1", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-        
-        // Start a second foo service provider
-        fooProvider2.start();
-        
-        arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        ServiceReference arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        assertNotNull("Check architecture 2 availability", arch_ps2);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        PrimitiveInstanceDescription id_ps2 = (PrimitiveInstanceDescription) ((Architecture) getContext().getService(arch_ps2)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);
-        assertTrue("Check instance 2 invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 3 ", dhd.getDependencies()[0].getServiceReferences().size(), 2);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        //id_ps2 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        ProvidedServiceHandlerDescription psh1 = getPSDesc(id_ps1);
-        ProvidedServiceHandlerDescription psh2 = getPSDesc(id_ps2);
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertEquals("Check POJO creation", id_ps2.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 2.1", dhd.getDependencies()[0].getUsedServices().contains(psh1.getProvidedServices()[0].getServiceReference()));
-        assertTrue("Check service reference - 2.2", dhd.getDependencies()[0].getUsedServices().contains(psh2.getProvidedServices()[0].getServiceReference()));
-        
-        fooProvider2.stop();
-        
-        arch_ps1 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps1);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps1.getState() == ComponentInstance.VALID);				
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        assertEquals("Check dependency ref - 2 ", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        psh = getPSDesc(id_ps1);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertEquals("Check POJO creation", id_ps1.getCreatedObjects().length, 1);
-        assertTrue("Check service reference - 3", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-
-        fooProvider1.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        fooProvider2.start();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        arch_ps2 = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), fooProvider2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ps2);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id_ps2.getState() == ComponentInstance.VALID);
-        psh = getPSDesc(id_ps2);
-        assertTrue("Check instance validity", id_dep.getState() == ComponentInstance.VALID);
-        assertTrue("Check dependency handler validity", dhd.isValid());
-        
-        assertEquals("Check dependency ref -3", dhd.getDependencies()[0].getServiceReferences().size(), 1);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        // Check object graph 
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        dhd = getDependencyDesc(id_dep);
-        //id_ps1 = ((Architecture) getContext().getService(arch_ps1)).getInstanceDescription();
-        psh = getPSDesc(id_ps2);
-        assertEquals("Check Service Reference equality", psh.getProvidedServices()[0].getServiceReference(), dhd.getDependencies()[0].getServiceReference());
-        assertTrue("Check service reference - 4", dhd.getDependencies()[0].getUsedServices().contains(psh.getProvidedServices()[0].getServiceReference()));
-
-        fooProvider2.stop();
-        
-        //id_dep = ((Architecture) getContext().getService(arch_dep)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id_dep.getState() == ComponentInstance.VALID);
-        dhd = getDependencyDesc(id_dep);
-        assertTrue("Check dependency handler invalidity", dhd.isValid());
-        
-        id_dep = null;
-        cs = null;
-        getContext().ungetService(arch_dep);
-        getContext().ungetService(cs_ref);
-    }
-    
-    
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
deleted file mode 100644
index 51045e2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/DependencyTestSuite.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.di.DefaultImplementationTestSuite;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.inner.InnerProxyMixTest;
-import org.osgi.framework.BundleContext;
-
-public class DependencyTestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Service Dependencies Test Suite", bc);
-        ots.addTestSuite(SimpleDependencies.class);
-        ots.addTestSuite(ProxiedSimpleDependencies.class);
-        ots.addTestSuite(OptionalDependencies.class);
-        ots.addTestSuite(ProxiedOptionalDependencies.class);
-        ots.addTestSuite(OptionalNoNullableDependencies.class);
-        ots.addTestSuite(MultipleDependencies.class);
-        ots.addTestSuite(OptionalMultipleDependencies.class);
-        ots.addTestSuite(DelayedSimpleDependencies.class);
-        ots.addTestSuite(ProxiedDelayedSimpleDependencies.class);
-        ots.addTestSuite(DelayedOptionalDependencies.class);
-        ots.addTestSuite(ProxiedDelayedOptionalDependencies.class);
-        ots.addTestSuite(DelayedMultipleDependencies.class);
-        ots.addTestSuite(ProxiedDelayedMultipleDependencies.class);
-        ots.addTestSuite(DelayedOptionalMultipleDependencies.class);
-        ots.addTestSuite(ProxiedDelayedOptionalMultipleDependencies.class);
-        ots.addTestSuite(MethodSimpleDependencies.class);
-        ots.addTestSuite(MethodOptionalDependencies.class);
-        ots.addTestSuite(MethodMultipleDependencies.class);
-        ots.addTestSuite(MethodOptionalMultipleDependencies.class);
-        ots.addTestSuite(MethodDelayedSimpleDependencies.class);
-        ots.addTestSuite(MethodDelayedOptionalDependencies.class);
-        ots.addTestSuite(MethodDelayedMultipleDependencies.class);
-        ots.addTestSuite(MethodDelayedOptionalMultipleDependencies.class);
-        ots.addTest(DefaultImplementationTestSuite.suite(bc));
-        ots.addTestSuite(DependencyArchitectureTest.class);
-        ots.addTestSuite(ListMultipleDependencies.class);
-        ots.addTestSuite(ProxiedListMultipleDependencies.class);
-        ots.addTestSuite(VectorMultipleDependencies.class);
-        ots.addTestSuite(SetMultipleDependencies.class);
-        ots.addTestSuite(ProxiedSetMultipleDependencies.class);
-        ots.addTestSuite(CollectionMultipleDependencies.class);
-        ots.addTestSuite(ProxiedCollectionMultipleDependencies.class);
-        ots.addTestSuite(ModifyDependencies.class);
-        ots.addTestSuite(ProxyTest.class);
-        ots.addTestSuite(NonProxiedNotInterfaceDependencies.class);
-        ots.addTestSuite(InnerProxyMixTest.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
deleted file mode 100644
index 5c0afee..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ListMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ListMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleListCheckServiceProvider").createComponentInstance(i1);
-			
-			Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalListCheckServiceProvider").createComponentInstance(i2);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
deleted file mode 100644
index f454970..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedMultipleDependencies.java
+++ /dev/null
@@ -1,390 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodDelayedMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-		
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-		} catch(Exception e) { fail(e.getMessage()); }
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testObject() {
-		instance3.start();
-		
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		instance4.stop();
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance5.stop();
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testMap() {
-        instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 2);
-        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance6.stop();
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testDict() {
-        instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 3", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 3", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 3", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 3", ((Integer)props.get("dictU")).intValue(), 1);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance7.stop();
-        getContext().ungetService(cs_ref);
-    }
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
deleted file mode 100644
index e897558..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalDependencies.java
+++ /dev/null
@@ -1,363 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodDelayedOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance3, instance4, instance5, instance6, instance7;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-    }
-
-    public void tearDown() {
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7= null;
-        fooProvider = null;
-    }
-
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance3.stop();
-    }
-
-    public void testRef() {
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-    public void testBoth() {
-        instance5.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance5.stop();
-    }
-    
-    public void testMap() {
-        instance6.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance6.stop();
-    }
-    
-    public void testDict() {
-        instance7.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance7.stop();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
deleted file mode 100644
index 96e5f37..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedOptionalMultipleDependencies.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodDelayedOptionalMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	
-	public void setUp() {		
-		try {
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-		
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-		} catch(Exception e) { fail(e.getMessage()); }		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testObject() {
-		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 2);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 2);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		instance4.stop();
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
deleted file mode 100644
index b0e6f68..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodDelayedSimpleDependencies.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodDelayedSimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider;
-	
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectCheckServiceProvider").createComponentInstance(i3);
-			instance3.stop();
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefCheckServiceProvider").createComponentInstance(i4);
-			instance4.stop();
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-		} catch(Exception e) { fail(e.getMessage()); } 
-		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider.dispose();
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider = null;
-	}
-	
-	public void testObject() {
-		instance3.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance3.stop();
-	}
-	
-	public void testRef() {
-		instance4.start();
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	    assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	    assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-		
-		instance4.stop();
-	}
-	
-	public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance5.stop();
-    }
-	
-	public void testMap() {
-	        instance6.start();
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-	        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-	        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-            assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        fooProvider.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-	        
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        getContext().ungetService(cs_ref);
-	        
-	        instance6.stop();
-	}
-	
-	public void testDict() {
-        instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance7.stop();
-}
-	
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
deleted file mode 100644
index b2aa4e5..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodMultipleDependencies.java
+++ /dev/null
@@ -1,505 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefMultipleCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothMultipleCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapMultipleCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictMultipleCheckServiceProvider").createComponentInstance(i7);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 2", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	   public void testMap() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-	        
-	        fooProvider1.start();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-	        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-	        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-	        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-	        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-	        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-	        
-	        fooProvider2.start();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-	        
-	        cs = (CheckService) getContext().getService(cs_ref);
-	        props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-	        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation - 2", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation - 2", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 2);
-	        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-	        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-	        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-	        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-	        
-	        fooProvider1.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-	        
-	        cs = (CheckService) getContext().getService(cs_ref);
-	        props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-	        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 2);
-	        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 1);
-	        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-	        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-	        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-	        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-	        
-	        fooProvider2.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-	        
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        getContext().ungetService(cs_ref);
-	    }
-	   
-       public void testDict() {
-           ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-           assertNotNull("Check architecture availability", arch_ref);
-           InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-           assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-           
-           fooProvider1.start();
-           
-           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-           assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-           
-           ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-           assertNotNull("Check CheckService availability", cs_ref);
-           CheckService cs = (CheckService) getContext().getService(cs_ref);
-           Properties props = cs.getProps();
-           //Check properties
-           assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-           assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-           assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-           assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-           assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-           assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-           assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-           assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-           assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-           assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-           assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-           assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-           assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-           assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-           
-           fooProvider2.start();
-           
-           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-           assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-           
-           cs = (CheckService) getContext().getService(cs_ref);
-           props = cs.getProps();
-           //Check properties
-           assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-           assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-           assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-           assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-           assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-           assertEquals("check both bind callback invocation - 2", ((Integer)props.get("bothB")).intValue(), 0);
-           assertEquals("check both unbind callback invocation - 2", ((Integer)props.get("bothU")).intValue(), 0);
-           assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-           assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-           assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 2);
-           assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-           assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-           assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-           assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-           
-           fooProvider1.stop();
-           
-           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-           assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-           
-           cs = (CheckService) getContext().getService(cs_ref);
-           props = cs.getProps();
-           //Check properties
-           assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-           assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-           assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-           assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-           assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-           assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-           assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-           assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-           assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-           assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 2);
-           assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
-           assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-           assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-           assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-           
-           fooProvider2.stop();
-           
-           id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-           assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-           
-           id = null;
-           cs = null;
-           getContext().ungetService(arch_ref);
-           getContext().ungetService(cs_ref);
-       }
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
deleted file mode 100644
index 8118bf5..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalDependencies.java
+++ /dev/null
@@ -1,430 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance3, instance4, instance5, instance6, instance7;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalCheckServiceProvider").createComponentInstance(i4);
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapOptionalCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictOptionalCheckServiceProvider").createComponentInstance(i7);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void tearDown() {
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider = null;
-    }
-
-    public void testObject() {
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
deleted file mode 100644
index a1312f2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodOptionalMultipleDependencies.java
+++ /dev/null
@@ -1,280 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodOptionalMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-			
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 2);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 2);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
deleted file mode 100644
index 238a63d..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MethodSimpleDependencies.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MethodSimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "MObjectCheckServiceProvider").createComponentInstance(i3);
-            assertNotNull("check instance 3", instance3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "MRefCheckServiceProvider").createComponentInstance(i4);
-            assertNotNull("check instance 4", instance4);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "MBothCheckServiceProvider").createComponentInstance(i5);
-            assertNotNull("check instance 5", instance5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MMapCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "MDictCheckServiceProvider").createComponentInstance(i7);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-		fooProvider = null;
-	}
-
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java
deleted file mode 100644
index c99951f..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ModifyDependencies.java
+++ /dev/null
@@ -1,406 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-
-public class ModifyDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance2, instance3, instance4, instance5, instance7, instance8;
-    ComponentInstance fooProvider;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-Updatable").createComponentInstance(prov);
-            fooProvider.stop();
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "VoidModifyCheckServiceProvider").createComponentInstance(i2);
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ObjectModifyCheckServiceProvider").createComponentInstance(i3);
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "RefModifyCheckServiceProvider").createComponentInstance(i4);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothModifyCheckServiceProvider").createComponentInstance(i5);
-                        
-            Properties i7 = new Properties();
-            i7.put("instance.name","Map");
-            instance7 = Utils.getFactoryByName(getContext(), "MapModifyCheckServiceProvider").createComponentInstance(i7);
-            
-            Properties i8 = new Properties();
-            i8.put("instance.name","Dictionary");
-            instance8 = Utils.getFactoryByName(getContext(), "DictModifyCheckServiceProvider").createComponentInstance(i8);
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance7.dispose();
-        instance8.dispose();
-        fooProvider.dispose();
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance7 = null;
-        instance8 = null;
-        fooProvider = null;
-    }
-    
-   public void testVoid() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        Object o = getContext().getService(cs_ref);
-        CheckService cs = (CheckService) o;
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check modify -1", ((Integer)props.get("modified")).intValue(), 1); // Already called inside the method
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        FooService fs = (FooService) getContext().getService(ref);
-        
-        fs.foo(); // Update
-        
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1.1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1.1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -1.1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1.1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1.1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1.1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1.1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1.1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1.1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3); // 1 (first foo) + 1 (our foo) + 1 (check foo)        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        fs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(ref);
-
-    }
-    
-    public void testObject() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
-
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        FooService fs = (FooService) getContext().getService(ref);
-        
-        fs.foo(); // Update
-        
-        props = cs.getProps();
-        //Check properties
-        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
-        
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        fs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(ref);	
-    }
-    
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
-
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        FooService fs = (FooService) getContext().getService(ref);
-        
-        fs.foo(); // Update
-        
-        props = cs.getProps();
-        //Check properties
-        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        fs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(ref); 
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
-
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        FooService fs = (FooService) getContext().getService(ref);
-        
-        fs.foo(); // Update
-        
-        props = cs.getProps();
-        //Check properties
-        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        fs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(ref); 
-    }
-
-    
-    public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
-
-        ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-        FooService fs = (FooService) getContext().getService(ref);
-        
-        fs.foo(); // Update
-        
-        props = cs.getProps();
-        //Check properties
-        assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        fs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        getContext().ungetService(ref); 
-    }
-    
-       public void testDict() {
-            ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance8.getInstanceName());
-            assertNotNull("Check architecture availability", arch_ref);
-            InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-            
-            fooProvider.start();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-            
-            ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance8.getInstanceName());
-            assertNotNull("Check CheckService availability", cs_ref);
-            CheckService cs = (CheckService) getContext().getService(cs_ref);
-            Properties props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-            assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-            assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-            assertEquals("check modify -1 (" + ((Integer)props.get("modified")).intValue() + ")", ((Integer)props.get("modified")).intValue(), 1);
-
-            ServiceReference ref = Utils.getServiceReferenceByName(getContext(), FooService.class.getName(), fooProvider.getInstanceName());
-            FooService fs = (FooService) getContext().getService(ref);
-            
-            fs.foo(); // Update
-            
-            props = cs.getProps();
-            //Check properties
-            assertEquals("check modify -1.1", ((Integer)props.get("modified")).intValue(), 3);
-            
-            fooProvider.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-            
-            id = null;
-            cs = null;
-            fs = null;
-            getContext().ungetService(arch_ref);
-            getContext().ungetService(cs_ref);
-            getContext().ungetService(ref); 
-        }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
deleted file mode 100644
index 837afc0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/MultipleDependencies.java
+++ /dev/null
@@ -1,385 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class MultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2, instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleMultipleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidMultipleCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefMultipleCheckServiceProvider").createComponentInstance(i4);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/NonProxiedNotInterfaceDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/NonProxiedNotInterfaceDependencies.java
deleted file mode 100644
index b15e578..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/NonProxiedNotInterfaceDependencies.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.AbstractMap;
-import java.util.HashMap;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.osgi.framework.ServiceRegistration;
-
-public class NonProxiedNotInterfaceDependencies extends OSGiTestCase {
-
-    InstanceManager instance1;
-    ComponentInstance fooProvider;
-
-    ServiceRegistration reg, reg2;
-    IPOJOHelper helper;
-
-    public void setUp() {
-    	helper = new IPOJOHelper(this);
-    	reg = context.registerService(String.class.getName(), "ahahah", null);
-    	reg2 = context.registerService(AbstractMap.class.getName(), new HashMap(), null);
-
-    }
-
-    public void tearDown() {
-    	if (reg != null) {
-    		reg.unregister();
-    	}
-    	if (reg2 != null) {
-    		reg2.unregister();
-    	}
-    }
-
-    public void testInstanceCreation() {
-    	instance1 = (InstanceManager) helper
-    		.createComponentInstance("org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceUsingStringService");
-    	Assert.assertTrue(instance1.getState() == ComponentInstance.VALID);
-    	Assert.assertTrue(((CheckService) instance1.getPojoObject()).check());
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
deleted file mode 100644
index 61450be..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalDependencies.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-			
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalCheckServiceProvider").createComponentInstance(i7);
-		} catch(Exception e) { fail(e.getMessage()); }		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1 ("+props.get("object")+")", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, a provider is there
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -3 ("+((Integer)props.get("voidU")) + ")", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 3", props.get("object"));
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2 (" + ((Integer)props.get("objectB")).intValue() + ")", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue()); // Nullable object.
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 1);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 1);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	   public void testDict() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-	        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-	        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        fooProvider.start();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-	        
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        cs = (CheckService) getContext().getService(cs_ref);
-	        props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-	        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-	        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-	        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 1);
-	        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        fooProvider.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-	        
-	        cs = (CheckService) getContext().getService(cs_ref);
-	        props = cs.getProps();
-	        //Check properties
-	        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-	        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-	        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-	        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 1);
-	        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
-	  
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        getContext().ungetService(cs_ref);
-	    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
deleted file mode 100644
index 7c1f0da..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalMultipleDependencies.java
+++ /dev/null
@@ -1,500 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2, instance3, instance4;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-		assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 2);
-		assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 2);
-		assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 2);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-		assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-		assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 2);
-		assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-		assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-		assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
deleted file mode 100644
index a2d47f1..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/OptionalNoNullableDependencies.java
+++ /dev/null
@@ -1,545 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalNoNullableDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-			
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleOptionalNoNullableCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidOptionalNoNullableCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectOptionalNoNullableCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefOptionalNoNullableCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothOptionalNoNullableCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "MapOptionalNoNullableCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "DictOptionalNoNullableCheckServiceProvider").createComponentInstance(i7);
-		} catch(Exception e) { 
-		    e.getMessage();
-		    fail(e.getMessage()); 
-		}		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		
-		//Check properties
-		// no service, no nullable => runtime exception expected
-		assertTrue("check excepted exception", ((Boolean) props.get("exception")).booleanValue());
-		assertNull("check CheckService invocation - 1 (" + props.get("result") + ")", props.get("result")); // Null
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1 ("+props.get("object")+")", props.get("object"));
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, a provider is there
-		// No exception expected
-		assertFalse("check unexcepted exception", ((Boolean) props.get("exception")).booleanValue());
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation - 1", props.get("result")); // Null, no provider
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation -3", props.get("result"));
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -3 ("+((Integer)props.get("voidU")) + ")", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 3", props.get("object"));
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2 (" + ((Integer)props.get("objectB")).intValue() + ")", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation -3", props.get("result")); // No provider.
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation -1", props.get("result")); //Null, no provider
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 1);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 1);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testDict() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-    public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -1", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertNull("check CheckService invocation -3", props.get("result")); // Null, no provider
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-    
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedCollectionMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedCollectionMultipleDependencies.java
deleted file mode 100644
index 79943853..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedCollectionMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ProxiedCollectionMultipleDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider1.stop();
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleCollectionCheckServiceProvider").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedOptionalCollectionCheckServiceProvider").createComponentInstance(i2);
-        } catch(Exception e) { fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimple() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedMultipleDependencies.java
deleted file mode 100644
index 8f3e0d6..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedMultipleDependencies.java
+++ /dev/null
@@ -1,518 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class ProxiedDelayedMultipleDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleMultipleCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidMultipleCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectMultipleCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefMultipleCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-            
-             Properties i5 = new Properties();
-             i5.put("instance.name","Both");
-             instance5 = Utils.getFactoryByName(getContext(), "ProxiedBothMultipleCheckServiceProvider").createComponentInstance(i5);
-             instance5.stop();
-             
-             Properties i6 = new Properties();
-             i6.put("instance.name","Map");
-             instance6 = Utils.getFactoryByName(getContext(), "ProxiedMapMultipleCheckServiceProvider").createComponentInstance(i6);
-             instance6.stop();
-             
-             Properties i7 = new Properties();
-             i7.put("instance.name","Dict");
-             instance7 = Utils.getFactoryByName(getContext(), "ProxiedDictMultipleCheckServiceProvider").createComponentInstance(i7);
-             instance7.stop();
-        
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-        } catch(Exception e) { fail(e.getMessage()); }
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimple() {
-        instance1.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance1.stop();
-    }
-    
-    public void testVoid() {
-        instance2.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 2);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);	
-        instance2.stop();
-    }
-    
-    public void testObject() {
-        instance3.start();
-        
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 2);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        instance3.stop();
-    }
-    
-    public void testRef() {
-        instance4.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 2);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance4.stop();
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 2);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance5.stop();
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testMap() {
-            instance6.start();
-            ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-            assertNotNull("Check architecture availability", arch_ref);
-            InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-            
-            ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-            assertNotNull("Check CheckService availability", cs_ref);
-            CheckService cs = (CheckService) getContext().getService(cs_ref);
-            Properties props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-            assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
-            assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-            assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-            
-            assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-            assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-            assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-            
-            fooProvider1.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-            
-            cs = (CheckService) getContext().getService(cs_ref);
-            props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-            assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 2);
-            assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 1);
-            assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-            assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-            assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-            assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-            assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-            
-            fooProvider2.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-            
-            id = null;
-            cs = null;
-            getContext().ungetService(arch_ref);
-            instance6.stop();
-            getContext().ungetService(cs_ref);
-    }
-    
-    public void testDict() {
-        instance7.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 2.0, 0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 2);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 1);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0, 0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        instance7.stop();
-        getContext().ungetService(cs_ref);
-    }
-
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalDependencies.java
deleted file mode 100644
index 2fca044..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalDependencies.java
+++ /dev/null
@@ -1,492 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-
-public class ProxiedDelayedOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidOptionalCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefOptionalCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "ProxiedBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "ProxiedMapOptionalCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "ProxiedDictOptionalCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-    }
-
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider = null;
-    }
-
-    public void testSimple() {
-        instance1.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 0.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance1.stop();
-    }
-
-    public void testVoid() {
-        instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 0.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance2.stop();
-    }
-
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance3.stop();
-    }
-
-    public void testRef() {
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-    public void testBoth() {
-        instance5.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 1);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance5.stop();
-    }
-    
-    public void testMap() {
-        instance6.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance6.stop();
-    }
-    
-    public void testDict() {
-        instance7.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 1", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 1", ((Integer)props.get("dictU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation - 2", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation - 2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation - 2", ((Integer)props.get("dictB")).intValue(), 1);
-        assertEquals("check dict unbind callback invocation - 2", ((Integer)props.get("dictU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance7.stop();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalMultipleDependencies.java
deleted file mode 100644
index 3609844..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedOptionalMultipleDependencies.java
+++ /dev/null
@@ -1,356 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ProxiedDelayedOptionalMultipleDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2, instance3, instance4;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {		
-        try {
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleOptionalMultipleCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidOptionalMultipleCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectOptionalMultipleCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefOptionalMultipleCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-        
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-        } catch(Exception e) { fail(e.getMessage()); }		
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimple() {
-        instance1.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-        instance1.stop();
-    }
-    
-    public void testVoid() {
-        instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 2);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 2);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 2);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 2);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        instance2.stop();
-    }
-    
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 2);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 2);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 2);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-        instance3.stop();
-    }
-    
-    public void testRef() {
-        instance4.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 2);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 1);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 2);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 2);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        instance4.stop();
-    }
-
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedSimpleDependencies.java
deleted file mode 100644
index 982dfe5..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedDelayedSimpleDependencies.java
+++ /dev/null
@@ -1,364 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-public class ProxiedDelayedSimpleDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-    ComponentInstance fooProvider;
-    
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "ProxiedBothCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "ProxiedMapCheckServiceProvider").createComponentInstance(i6);
-            instance6.stop();
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dict");
-            instance7 = Utils.getFactoryByName(getContext(), "ProxiedDictCheckServiceProvider").createComponentInstance(i7);
-            instance7.stop();
-        } catch(Exception e) { fail(e.getMessage()); } 
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider = null;
-    }
-    
-    public void testSimple() {
-        instance1.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        fooProvider.stop();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        fooProvider.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        fooProvider.stop();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        instance1.stop();
-    }
-    
-    public void testVoid() {
-        instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-            
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance2.stop();
-    }
-    
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();		
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-            
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance3.stop();
-    }
-    
-    public void testRef() {
-        instance4.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance4.stop();
-    }
-    
-    public void testBoth() {
-        instance5.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance5.stop();
-    }
-    
-    public void testMap() {
-        instance6.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-       
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-        
-        instance6.stop();
-    }
-       public void testDict() {
-            instance7.start();
-            ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-            assertNotNull("Check architecture availability", arch_ref);
-            InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-            
-            ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-            assertNotNull("Check CheckService availability", cs_ref);
-            CheckService cs = (CheckService) getContext().getService(cs_ref);
-            Properties props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-            assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-            assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-           
-            assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-            
-            fooProvider.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-            
-            id = null;
-            cs = null;
-            getContext().ungetService(arch_ref);
-            getContext().ungetService(cs_ref);
-            
-            instance7.stop();
-        }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedListMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedListMultipleDependencies.java
deleted file mode 100644
index 9365c1c..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedListMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ProxiedListMultipleDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider1.stop();
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleListCheckServiceProvider").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedOptionalListCheckServiceProvider").createComponentInstance(i2);
-        } catch(Exception e) { fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimple() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedOptionalDependencies.java
deleted file mode 100644
index eef46e2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedOptionalDependencies.java
+++ /dev/null
@@ -1,547 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class ProxiedOptionalDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7;
-    ComponentInstance fooProvider;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider.stop();
-            
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidOptionalCheckServiceProvider").createComponentInstance(i2);
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefOptionalCheckServiceProvider").createComponentInstance(i4);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "ProxiedBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Map");
-            instance6 = Utils.getFactoryByName(getContext(), "ProxiedMapOptionalCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Dictionary");
-            instance7 = Utils.getFactoryByName(getContext(), "ProxiedDictOptionalCheckServiceProvider").createComponentInstance(i7);
-        } catch(Exception e) { fail(e.getMessage()); }		
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        fooProvider = null;
-    }
-    
-    public void testSimple() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        
-        //Check properties
-        assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 1 ("+props.get("object")+")", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, a provider is there
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testVoid() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -3 ("+((Integer)props.get("voidU")) + ")", ((Integer)props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 3", props.get("object"));
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);	
-    }
-    
-    public void testObject() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2 (" + ((Integer)props.get("objectB")).intValue() + ")", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue()); // Nullable object.
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 1);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 1);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 1);
-        assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 0);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-       public void testDict() {
-            ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-            assertNotNull("Check architecture availability", arch_ref);
-            InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-            
-            ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-            assertNotNull("Check CheckService availability", cs_ref);
-            CheckService cs = (CheckService) getContext().getService(cs_ref);
-            Properties props = cs.getProps();
-            //Check properties
-            assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-            assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-            
-            fooProvider.start();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-            
-            assertNotNull("Check CheckService availability", cs_ref);
-            cs = (CheckService) getContext().getService(cs_ref);
-            props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-            assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-            assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation -2", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -2", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -2", ((Integer)props.get("dictB")).intValue(), 1);
-            assertEquals("check dict unbind callback invocation -2", ((Integer)props.get("dictU")).intValue(), 0);
-            
-            fooProvider.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-            
-            cs = (CheckService) getContext().getService(cs_ref);
-            props = cs.getProps();
-            //Check properties
-            assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-            assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-            assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation -3", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -3", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -3", ((Integer)props.get("dictB")).intValue(), 1);
-            assertEquals("check dict unbind callback invocation -3", ((Integer)props.get("dictU")).intValue(), 1);
-      
-            id = null;
-            cs = null;
-            getContext().ungetService(arch_ref);
-            getContext().ungetService(cs_ref);
-        }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSetMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSetMultipleDependencies.java
deleted file mode 100644
index 002d57f..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSetMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ProxiedSetMultipleDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2;
-    ComponentInstance fooProvider1, fooProvider2;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider1");
-            fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider1.stop();
-        
-            Properties prov2 = new Properties();
-            prov2.put("instance.name","FooProvider2");
-            fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-            fooProvider2.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleSetCheckServiceProvider").createComponentInstance(i1);
-            
-            Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedOptionalSetCheckServiceProvider").createComponentInstance(i2);
-        } catch(Exception e) { fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        fooProvider1.dispose();
-        fooProvider2.dispose();
-        instance1 = null;
-        instance2 = null;
-        fooProvider1 = null;
-        fooProvider2 = null;
-    }
-    
-    public void testSimple() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSimpleDependencies.java
deleted file mode 100644
index a87026f..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxiedSimpleDependencies.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class ProxiedSimpleDependencies extends OSGiTestCase {
-    
-    ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7, instance8;
-    ComponentInstance fooProvider;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider.stop();
-        
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "ProxiedSimpleCheckServiceProvider").createComponentInstance(i1);
-        
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "ProxiedVoidCheckServiceProvider").createComponentInstance(i2);
-        
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "ProxiedObjectCheckServiceProvider").createComponentInstance(i3);
-        
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "ProxiedRefCheckServiceProvider").createComponentInstance(i4);
-            
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "ProxiedBothCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Double");
-            instance6 = Utils.getFactoryByName(getContext(), "ProxiedDoubleCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Map");
-            instance7 = Utils.getFactoryByName(getContext(), "ProxiedMapCheckServiceProvider").createComponentInstance(i7);
-            
-            Properties i8 = new Properties();
-            i8.put("instance.name","Dictionary");
-            instance8 = Utils.getFactoryByName(getContext(), "ProxiedDictCheckServiceProvider").createComponentInstance(i8);
-        } catch(Exception e) { 
-            e.printStackTrace();
-            fail(e.getMessage()); }
-        
-    }
-    
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        instance6.dispose();
-        instance7.dispose();
-        instance8.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        instance6 = null;
-        instance7 = null;
-        instance8 = null;
-        fooProvider = null;
-    }
-    
-    public void testSimple() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        assertTrue("check CheckService invocation", cs.check());
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testVoid() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        Object o = getContext().getService(cs_ref);
-        CheckService cs = (CheckService) o;
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testObject() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);		
-    }
-    
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testDouble() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertNotNull("Check cs", cs);
-        cs.check();
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-    
-    public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-       public void testDict() {
-            ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance8.getInstanceName());
-            assertNotNull("Check architecture availability", arch_ref);
-            InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-            
-            fooProvider.start();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-            
-            ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance8.getInstanceName());
-            assertNotNull("Check CheckService availability", cs_ref);
-            CheckService cs = (CheckService) getContext().getService(cs_ref);
-            Properties props = cs.getProps();
-            //Check properties
-            assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-            assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-            assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-            assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-            assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-            assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-            assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-            assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-            assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-            assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-            assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-            assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-            assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-            
-            fooProvider.stop();
-            
-            id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-            assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-            
-            id = null;
-            cs = null;
-            getContext().ungetService(arch_ref);
-            getContext().ungetService(cs_ref);
-        }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxyTest.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxyTest.java
deleted file mode 100644
index b68624b..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/ProxyTest.java
+++ /dev/null
@@ -1,232 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-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.handlers.dependency.DependencyHandler;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class ProxyTest extends OSGiTestCase {
-
-
-    public void testDelegation() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties prov = new Properties();
-        prov.put("instance.name","FooProvider1-Proxy");
-        ComponentInstance fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-        
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceDelegator").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
-        
-        assertTrue(cs.check());
-        
-        fooProvider1.dispose();
-        instance1.dispose();
-    }
-    
-    public void testDelegationOnNullable() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties i1 = new Properties();
-        i1.put("instance.name","DelegatorNullable");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceDelegator").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
-        
-        assertFalse(cs.check()); // Nullable.
-        
-        instance1.dispose();
-    }
-    
-    
-    public void testGetAndDelegation() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties prov = new Properties();
-        prov.put("instance.name","FooProvider1-Proxy");
-        ComponentInstance fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-        
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceGetAndDelegate").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
-
-        
-        assertTrue(cs.check());
-        
-        fooProvider1.dispose();
-        instance1.dispose();
-    }
-    
-    public void testGetAndDelegationOnNullable() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties i1 = new Properties();
-        i1.put("instance.name","DelegatorNullable");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceGetAndDelegate").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
-
-        assertFalse(cs.check()); // Nullable.
-        
-        
-        instance1.dispose();
-    }
-    
-    public void testImmediate() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties prov = new Properties();
-        prov.put("instance.name","FooProvider1-Proxy");
-        ComponentInstance fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-        
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceNoDelegate").createComponentInstance(i1);
-        
-        ServiceReference ref = Utils.getServiceReference(context, CheckService.class.getName(), "(service.pid=Helper)");
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertTrue(helper.toString().contains("$$Proxy")); // This is the suffix.
-
-        assertTrue(cs.check());
-        
-        fooProvider1.dispose();
-        instance1.dispose();
-    }
-    
-    public void testImmediateNoService() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator-with-no-service");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceNoDelegate").createComponentInstance(i1);
-        
-        ServiceReference ref = Utils.getServiceReference(context, CheckService.class.getName(), "(service.pid=Helper)");
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        try {
-            cs.getProps();
-            fail("Exception expected");
-        } catch(RuntimeException e) {
-            //OK
-        }
-        
-        instance1.dispose();
-    }
-    
-    public void testProxyDisabled() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        // Disable proxy
-        System.setProperty(DependencyHandler.PROXY_SETTINGS_PROPERTY, DependencyHandler.PROXY_DISABLED);
-        Properties prov = new Properties();
-        prov.put("instance.name","FooProvider1-Proxy");
-        ComponentInstance fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-        
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceDelegator").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertFalse(helper.toString().contains("$$Proxy")); // Not a proxy.
-        
-        assertTrue(cs.check());
-        
-        fooProvider1.dispose();
-        instance1.dispose();
-        System.setProperty(DependencyHandler.PROXY_SETTINGS_PROPERTY, DependencyHandler.PROXY_ENABLED);
-
-    }
-    
-    public void testDynamicProxy() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        // Dynamic proxy
-        System.setProperty(DependencyHandler.PROXY_TYPE_PROPERTY, DependencyHandler.DYNAMIC_PROXY);
-        Properties prov = new Properties();
-        prov.put("instance.name","FooProvider1-Proxy");
-        ComponentInstance fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-        
-        
-        Properties i1 = new Properties();
-        i1.put("instance.name","Delegator");
-        ComponentInstance instance1 = Utils.getFactoryByName(getContext(), 
-                "org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceDelegator").createComponentInstance(i1);
-        
-        
-        ServiceReference ref = Utils.getServiceReferenceByName(context, CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull(ref);
-        CheckService cs = (CheckService) context.getService(ref);
-        
-        Properties props = cs.getProps();
-        FooService helper = (FooService) props.get("helper.fs");
-        assertNotNull(helper);
-        assertFalse(helper.toString().contains("$$Proxy")); // Dynamic proxy.
-        assertTrue(helper.toString().contains("DynamicProxyFactory"));
-        assertTrue(helper.hashCode() > 0);
-        
-        assertTrue(helper.equals(helper));
-        assertFalse(helper.equals(i1)); // This is a quite stupid test...
-
-        assertTrue(cs.check());
-        
-        fooProvider1.dispose();
-        instance1.dispose();
-        System.setProperty(DependencyHandler.PROXY_TYPE_PROPERTY, DependencyHandler.SMART_PROXY);
-
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java
deleted file mode 100644
index 9ec946d..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SetMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class SetMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleSetCheckServiceProvider").createComponentInstance(i1);
-			
-			Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalSetCheckServiceProvider").createComponentInstance(i2);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
deleted file mode 100644
index 8c03ab2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/SimpleDependencies.java
+++ /dev/null
@@ -1,414 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class SimpleDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5, instance6, instance7, instance8;
-	ComponentInstance fooProvider;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "VoidCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "ObjectCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "RefCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "BothCheckServiceProvider").createComponentInstance(i5);
-            
-            Properties i6 = new Properties();
-            i6.put("instance.name","Double");
-            instance6 = Utils.getFactoryByName(getContext(), "DoubleCheckServiceProvider").createComponentInstance(i6);
-            
-            Properties i7 = new Properties();
-            i7.put("instance.name","Map");
-            instance7 = Utils.getFactoryByName(getContext(), "MapCheckServiceProvider").createComponentInstance(i7);
-            
-            Properties i8 = new Properties();
-            i8.put("instance.name","Dictionary");
-            instance8 = Utils.getFactoryByName(getContext(), "DictCheckServiceProvider").createComponentInstance(i8);
-		} catch(Exception e) { 
-		    e.printStackTrace();
-		    fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		instance6.dispose();
-		instance7.dispose();
-		instance8.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		instance6 = null;
-		instance7 = null;
-		instance8 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		assertTrue("check CheckService invocation", cs.check());
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		Object o = getContext().getService(cs_ref);
-		CheckService cs = (CheckService) o;
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1 ("+((Integer)props.get("voidB")).intValue()+")", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	public void testDouble() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance6.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        assertNotNull("Check cs", cs);
-        cs.check();
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-	public void testMap() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance7.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 1);
-        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 0);
-        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-	
-	   public void testDict() {
-	        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance8.getInstanceName());
-	        assertNotNull("Check architecture availability", arch_ref);
-	        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-	        
-	        fooProvider.start();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance validity", id.getState() == ComponentInstance.VALID);
-	        
-	        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance8.getInstanceName());
-	        assertNotNull("Check CheckService availability", cs_ref);
-	        CheckService cs = (CheckService) getContext().getService(cs_ref);
-	        Properties props = cs.getProps();
-	        //Check properties
-	        assertTrue("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue());
-	        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-	        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-	        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-	        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-	        assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-	        assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-	        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-	        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-	        assertEquals("check map bind callback invocation -1", ((Integer)props.get("mapB")).intValue(), 0);
-	        assertEquals("check map unbind callback invocation -1", ((Integer)props.get("mapU")).intValue(), 0);
-	        assertEquals("check dict bind callback invocation -1", ((Integer)props.get("dictB")).intValue(), 1);
-	        assertEquals("check dict unbind callback invocation -1", ((Integer)props.get("dictU")).intValue(), 0);
-	        
-	        fooProvider.stop();
-	        
-	        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-	        assertTrue("Check instance invalidity - 2", id.getState() == ComponentInstance.INVALID);
-	        
-	        id = null;
-	        cs = null;
-	        getContext().ungetService(arch_ref);
-	        getContext().ungetService(cs_ref);
-	    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
deleted file mode 100644
index 9397917..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/VectorMultipleDependencies.java
+++ /dev/null
@@ -1,248 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class VectorMultipleDependencies extends OSGiTestCase {
-
-	ComponentInstance instance1, instance2;
-	ComponentInstance fooProvider1, fooProvider2;
-	
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider1");
-			fooProvider1 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider1.stop();
-		
-			Properties prov2 = new Properties();
-			prov2.put("instance.name","FooProvider2");
-			fooProvider2 = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov2);
-			fooProvider2.stop();
-		
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "SimpleVectorCheckServiceProvider").createComponentInstance(i1);
-			
-			Properties i2 = new Properties();
-            i2.put("instance.name","Optional");
-            instance2 = Utils.getFactoryByName(getContext(), "OptionalVectorCheckServiceProvider").createComponentInstance(i2);
-		} catch(Exception e) { fail(e.getMessage()); }
-		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		fooProvider1.dispose();
-		fooProvider2.dispose();
-		instance1 = null;
-		instance2 = null;
-		fooProvider1 = null;
-		fooProvider2 = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
-		
-		fooProvider1.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.start();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-		
-		fooProvider1.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-		assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider2.stop();
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testOptional() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 0", ((Boolean)props.get("result")).booleanValue()); // False : no provider
-        assertEquals("check void bind invocation - 0", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 0", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 0", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 0", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 0", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 0", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 0", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 0", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 0", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        fooProvider1.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, two providers are here
-        assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 2);
-        assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 2);
-        assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 2.0);
-        
-        fooProvider1.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation - 3", ((Boolean)props.get("result")).booleanValue()); // True, it still one provider.
-        assertEquals("check void bind invocation - 3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 1.0);
-        
-        fooProvider2.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation - 4", ((Boolean)props.get("result")).booleanValue()); // False, no more provider.
-        assertEquals("check void bind invocation - 4", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 4", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 4", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 4", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 4", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 4", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("Check FS invocation (int) - 4", ((Integer)props.get("int")).intValue(), 0);
-        assertEquals("Check FS invocation (long) - 4", ((Long)props.get("long")).longValue(), 0);
-        assertEquals("Check FS invocation (double) - 4", ((Double)props.get("double")).doubleValue(), 0.0);
-        
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);       
-    }
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java
deleted file mode 100644
index f754ce6..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DefaultImplementationTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class DefaultImplementationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Default Implementation Test Suite", bc);
-		ots.addTestSuite( OptionalDependencies.class);
-        ots.addTestSuite( MethodOptionalDependencies.class);
-        ots.addTestSuite( DelayedOptionalDependencies.class);
-        ots.addTestSuite( MethodDelayedOptionalDependencies.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
deleted file mode 100644
index 3bcd003..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/DelayedOptionalDependencies.java
+++ /dev/null
@@ -1,354 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class DelayedOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance1, instance2, instance3, instance4, instance5;
-
-    ComponentInstance fooProvider;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-
-            Properties i1 = new Properties();
-            i1.put("instance.name","Simple");
-            instance1 = Utils.getFactoryByName(getContext(), "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-            instance1.stop();
-
-            Properties i2 = new Properties();
-            i2.put("instance.name","Void");
-            instance2 = Utils.getFactoryByName(getContext(), "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
-            instance2.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-    }
-
-    public void tearDown() {
-        instance1.dispose();
-        instance2.dispose();
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        fooProvider.dispose();
-        instance1 = null;
-        instance2 = null;
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        fooProvider = null;
-    }
-
-    public void testSimple() {
-        instance1.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
-        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 5);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 5);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 5.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance1.stop();
-    }
-
-    public void testVoid() {
-        instance2.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNotNull("Check FS invocation (object) - 1", props.get("object"));
-        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
-        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
-        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 1);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 1);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-        assertNull("Check FS invocation (object) - 2", props.get("object"));
-        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 5);
-        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 5);
-        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 5.0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance2.stop();
-    }
-
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance3.stop();
-    }
-
-    public void testRef() {
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-    public void testBoth() {
-        instance5.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 1", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation - 2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation - 2", ((Integer) props.get("bothU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
deleted file mode 100644
index a2ba8d0..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodDelayedOptionalDependencies.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MethodDelayedOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance3, instance4, instance5;
-
-    ComponentInstance fooProvider;
-
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-            instance3.stop();
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
-            instance4.stop();
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
-            instance5.stop();
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-
-    }
-
-    public void tearDown() {
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        fooProvider = null;
-    }
-
-    public void testObject() {
-        instance3.start();
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance3.stop();
-    }
-
-    public void testRef() {
-        instance4.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-    public void testBoth() {
-        instance5.start();
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-
-        instance4.stop();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
deleted file mode 100644
index cbfab94..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/MethodOptionalDependencies.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class MethodOptionalDependencies extends OSGiTestCase {
-
-    ComponentInstance instance3, instance4, instance5;
-
-    ComponentInstance fooProvider;
-    
-    public void setUp() {
-        try {
-            Properties prov = new Properties();
-            prov.put("instance.name","FooProvider");
-            fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-            fooProvider.stop();
-
-            Properties i3 = new Properties();
-            i3.put("instance.name","Object");
-            instance3 = Utils.getFactoryByName(getContext(), "DIMObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-
-            Properties i4 = new Properties();
-            i4.put("instance.name","Ref");
-            instance4 = Utils.getFactoryByName(getContext(), "DIMRefOptionalCheckServiceProvider").createComponentInstance(i4);
-
-            Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "DIMBothOptionalCheckServiceProvider").createComponentInstance(i5);
-        } catch (Exception e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void tearDown() {
-        instance3.dispose();
-        instance4.dispose();
-        instance5.dispose();
-        fooProvider.dispose();
-        instance3 = null;
-        instance4 = null;
-        instance5 = null;
-        fooProvider = null;
-    }
-
-    public void testObject() {
-
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-
-        Properties props = cs.getProps();
-
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 1);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 1);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-    public void testRef() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 1);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 1);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 0);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-    
-    public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean) props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -1", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -1", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer) props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.start();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer) props.get("bothU")).intValue(), 0);
-
-        fooProvider.stop();
-
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        // Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean) props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer) props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer) props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer) props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer) props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer) props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer) props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer) props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer) props.get("bothU")).intValue(), 1);
-
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
deleted file mode 100644
index d1ca439..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/di/OptionalDependencies.java
+++ /dev/null
@@ -1,387 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.di;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class OptionalDependencies extends OSGiTestCase {
-	
-	ComponentInstance instance1, instance2, instance3, instance4, instance5;
-	ComponentInstance fooProvider;
-
-	public void setUp() {
-		try {
-			Properties prov = new Properties();
-			prov.put("instance.name","FooProvider");
-			fooProvider = Utils.getFactoryByName(getContext(), "FooProviderType-1").createComponentInstance(prov);
-			fooProvider.stop();
-			
-			Properties i1 = new Properties();
-			i1.put("instance.name","Simple");
-			instance1 = Utils.getFactoryByName(getContext(), "DISimpleOptionalCheckServiceProvider").createComponentInstance(i1);
-		
-			Properties i2 = new Properties();
-			i2.put("instance.name","Void");
-			instance2 = Utils.getFactoryByName(getContext(), "DIVoidOptionalCheckServiceProvider").createComponentInstance(i2);
-		
-			Properties i3 = new Properties();
-			i3.put("instance.name","Object");
-			instance3 = Utils.getFactoryByName(getContext(), "DIObjectOptionalCheckServiceProvider").createComponentInstance(i3);
-		
-			Properties i4 = new Properties();
-			i4.put("instance.name","Ref");
-			instance4 = Utils.getFactoryByName(getContext(), "DIRefOptionalCheckServiceProvider").createComponentInstance(i4);
-			
-			Properties i5 = new Properties();
-            i5.put("instance.name","Both");
-            instance5 = Utils.getFactoryByName(getContext(), "DIBothOptionalCheckServiceProvider").createComponentInstance(i5);
-		} catch(Exception e) { fail(e.getMessage()); }		
-	}
-	
-	public void tearDown() {
-		instance1.dispose();
-		instance2.dispose();
-		instance3.dispose();
-		instance4.dispose();
-		instance5.dispose();
-		fooProvider.dispose();
-		instance1 = null;
-		instance2 = null;
-		instance3 = null;
-		instance4 = null;
-		instance5 = null;
-		fooProvider = null;
-	}
-	
-	public void testSimple() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance1.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 5);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 5);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 5.0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		
-		//Check properties
-		assertTrue("check CheckService invocation - 2", ((Boolean)props.get("result")).booleanValue()); // True, a provider is there
-		assertEquals("check void bind invocation - 2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testVoid() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance2.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation - 1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation - 1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation - 1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation - 1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation - 1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation - 1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation - 1", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 1", props.get("object"));
-		assertEquals("Check FS invocation (int) - 1", ((Integer)props.get("int")).intValue(), 5);
-		assertEquals("Check FS invocation (long) - 1", ((Long)props.get("long")).longValue(), 5);
-		assertEquals("Check FS invocation (double) - 1", ((Double)props.get("double")).doubleValue(), 5.0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		assertNotNull("Check FS invocation (object) - 2", props.get("object"));
-		assertEquals("Check FS invocation (int) - 2", ((Integer)props.get("int")).intValue(), 1);
-		assertEquals("Check FS invocation (long) - 2", ((Long)props.get("long")).longValue(), 1);
-		assertEquals("Check FS invocation (double) - 2", ((Double)props.get("double")).doubleValue(), 1.0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 1);
-		assertEquals("check void unbind callback invocation -3 ("+((Integer)props.get("voidU")) + ")", ((Integer)props.get("voidU")).intValue(), 1);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		assertNull("Check FS invocation (object) - 3", props.get("object"));
-		assertEquals("Check FS invocation (int) - 3", ((Integer)props.get("int")).intValue(), 5);
-		assertEquals("Check FS invocation (long) - 3", ((Long)props.get("long")).longValue(), 5);
-		assertEquals("Check FS invocation (double) - 3", ((Double)props.get("double")).doubleValue(), 5.0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);	
-	}
-	
-	public void testObject() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance3.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2 (" + ((Integer)props.get("objectB")).intValue() + ")", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 1);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 1);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);		
-	}
-	
-	public void testRef() {
-		ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check architecture availability", arch_ref);
-		InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-		
-		ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance4.getInstanceName());
-		assertNotNull("Check CheckService availability", cs_ref);
-		CheckService cs = (CheckService) getContext().getService(cs_ref);
-		Properties props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-		assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -1", ((Integer)props.get("refB")).intValue(), 0);
-		assertEquals("check ref unbind callback invocation -1", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.start();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-		
-		assertNotNull("Check CheckService availability", cs_ref);
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-		
-		fooProvider.stop();
-		
-		id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-		assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-		
-		cs = (CheckService) getContext().getService(cs_ref);
-		props = cs.getProps();
-		//Check properties
-		assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-		assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-		assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-		assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-		assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-		assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 1);
-		assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 1);
-		
-		id = null;
-		cs = null;
-		getContext().ungetService(arch_ref);
-		getContext().ungetService(cs_ref);
-	}
-	
-	public void testBoth() {
-        ServiceReference arch_ref = Utils.getServiceReferenceByName(getContext(), Architecture.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check architecture availability", arch_ref);
-        InstanceDescription id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
-        
-        ServiceReference cs_ref = Utils.getServiceReferenceByName(getContext(), CheckService.class.getName(), instance5.getInstanceName());
-        assertNotNull("Check CheckService availability", cs_ref);
-        CheckService cs = (CheckService) getContext().getService(cs_ref);
-        Properties props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -1", ((Boolean)props.get("result")).booleanValue()); // False is returned (nullable)
-        assertEquals("check void bind invocation -1", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -1", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -1", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -1", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -1", ((Integer)props.get("bothB")).intValue(), 0);
-        assertEquals("check both unbind callback invocation -1", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.start();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
-        
-        assertNotNull("Check CheckService availability", cs_ref);
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertTrue("check CheckService invocation -2", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -2", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -2", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -2", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -2", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -2", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -2", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -2", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -2", ((Integer)props.get("bothU")).intValue(), 0);
-        
-        fooProvider.stop();
-        
-        id = ((Architecture) getContext().getService(arch_ref)).getInstanceDescription();
-        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
-        
-        cs = (CheckService) getContext().getService(cs_ref);
-        props = cs.getProps();
-        //Check properties
-        assertFalse("check CheckService invocation -3", ((Boolean)props.get("result")).booleanValue());
-        assertEquals("check void bind invocation -3", ((Integer)props.get("voidB")).intValue(), 0);
-        assertEquals("check void unbind callback invocation -3", ((Integer)props.get("voidU")).intValue(), 0);
-        assertEquals("check object bind callback invocation -3", ((Integer)props.get("objectB")).intValue(), 0);
-        assertEquals("check object unbind callback invocation -3", ((Integer)props.get("objectU")).intValue(), 0);
-        assertEquals("check ref bind callback invocation -3", ((Integer)props.get("refB")).intValue(), 0);
-        assertEquals("check ref unbind callback invocation -3", ((Integer)props.get("refU")).intValue(), 0);
-        assertEquals("check both bind callback invocation -3", ((Integer)props.get("bothB")).intValue(), 1);
-        assertEquals("check both unbind callback invocation -3", ((Integer)props.get("bothU")).intValue(), 1);
-  
-        id = null;
-        cs = null;
-        getContext().ungetService(arch_ref);
-        getContext().ungetService(cs_ref);
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/inner/InnerProxyMixTest.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/inner/InnerProxyMixTest.java
deleted file mode 100644
index 1a59c0a..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/inner/InnerProxyMixTest.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.inner;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.inner.C1;
-import org.apache.felix.ipojo.test.scenarios.component.inner.C2;
-import org.apache.felix.ipojo.test.scenarios.component.inner.C3;
-
-public class InnerProxyMixTest extends OSGiTestCase {
-
-	public static String C1 = C1.class.getName();
-	public static String C2 = C2.class.getName();
-	public static String C3 = C3.class.getName();
-
-	IPOJOHelper ipojo;
-	private ComponentInstance instancec1;
-	private ComponentInstance instancec2;
-	private ComponentInstance instancec3;
-
-	public void setUp() {
-		ipojo = new IPOJOHelper(this);
-		// Create the instances
-		instancec1 = ipojo.createComponentInstance(C1);
-		instancec2 = ipojo.createComponentInstance(C2);
-		instancec3 = ipojo.createComponentInstance(C3);
-	}
-
-	public void tearDown() {
-		ipojo.dispose();
-	}
-
-	public void testMix() {
-		// Check that everything is OK
-		assertEquals(ComponentInstance.VALID, instancec1.getState());
-		assertEquals(ComponentInstance.VALID, instancec2.getState());
-		assertEquals(ComponentInstance.VALID, instancec3.getState());
-
-		// Call C3
-		C3 svc = (C3) getServiceObject(C3, null);
-		assertNotNull(svc);
-		assertEquals("called", svc.getFilter().authenticate());
-
-		// So far, all right
-
-		//We stop c1 and c2.
-		instancec1.stop();
-		instancec2.stop();
-
-		assertEquals(ComponentInstance.INVALID, instancec3.getState()); // C2 dependency invalid
-
-		instancec1.start();
-		instancec2.start();
-
-		// Check that everything is OK
-		assertEquals(ComponentInstance.VALID, instancec1.getState());
-		assertEquals(ComponentInstance.VALID, instancec2.getState());
-		assertEquals(ComponentInstance.VALID, instancec3.getState());
-
-		// Call C3
-		svc = (C3) getServiceObject(C3, null);
-		assertNotNull(svc);
-		assertEquals("called", svc.getFilter().authenticate());
-	}
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceDelegator.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceDelegator.java
deleted file mode 100644
index 9d2c736..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceDelegator.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class CheckServiceDelegator implements CheckService {
-
-    private FooService fs;
-    
-    private Helper helper;
-    
-    public CheckServiceDelegator(BundleContext bc) {
-        helper = new Helper(bc, fs);
-    }
-    
-    public boolean check() {
-        // Don't access the service
-        // Just delegate
-        return helper.check();
-    }
-
-    public Properties getProps() {
-        // Don't access the service
-        // Just delegate
-        return helper.getProps();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceGetAndDelegate.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceGetAndDelegate.java
deleted file mode 100644
index 7f8be1e..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceGetAndDelegate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class CheckServiceGetAndDelegate implements CheckService {
-
-    private FooService fs;
-    
-    private Helper helper;
-    
-    public CheckServiceGetAndDelegate(BundleContext bc) {
-        helper = new Helper(bc, fs);
-    }
-    
-    public boolean check() {
-        fs.foo();
-        return helper.check();
-    }
-
-    public Properties getProps() {
-        fs.getBoolean();
-        return helper.getProps();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceNoDelegate.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceNoDelegate.java
deleted file mode 100644
index a72e313..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceNoDelegate.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class CheckServiceNoDelegate implements CheckService {
-
-    private FooService fs;
-    
-    private Helper helper;
-    
-    private BundleContext context;
-    
-    public CheckServiceNoDelegate(BundleContext bc) {
-       context = bc;
-       helper = new Helper(context, fs);
-    }
-    
-    public void start() {
-        helper.publish();
-    }
-    
-    public void stop() {
-        helper.unpublish();
-    }
-    
-    public boolean check() {
-        // Don't access the service
-        // Just delegate
-        return helper.check();
-    }
-
-    public Properties getProps() {
-        // Don't access the service
-        // Just delegate
-        return helper.getProps();
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceUsingStringService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceUsingStringService.java
deleted file mode 100644
index f822b95..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/CheckServiceUsingStringService.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.proxy;
-
-import java.util.AbstractMap;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-
-public class CheckServiceUsingStringService implements CheckService {
-
-    private String string;
-    private AbstractMap map;
-
-
-    public CheckServiceUsingStringService() {
-    	System.out.println("Service : " + string);
-    	System.out.println("Map : " + map);
-    }
-
-    public boolean check() {
-        return string != null
-        	&& map != null;
-    }
-
-    public Properties getProps() {
-    	return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/Helper.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/Helper.java
deleted file mode 100644
index c2f0f29..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/proxy/Helper.java
+++ /dev/null
@@ -1,47 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceRegistration;
-
-public class Helper implements CheckService {
-    
-    
-    private FooService fs;
-    private BundleContext context;
-    private ServiceRegistration reg;
-    
-    public Helper(BundleContext bc, FooService svc) {
-        fs = svc;
-        context = bc;    
-    }
-    
-    public void publish() {
-        Properties props = new Properties();
-        props.put(Constants.SERVICE_PID, "Helper");
-        reg = context.registerService(CheckService.class.getName(), this, props);
-    }
-    
-    public void unpublish() {
-        if (reg != null) {
-            reg.unregister();
-        }
-        reg = null;
-    }
-
-    public boolean check() {
-        return fs.foo();
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        fs.getBoolean();
-        props.put("helper.fs", fs);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/Call.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/Call.java
deleted file mode 100644
index 34513fb..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/Call.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.service.dependency.service;
-
-public interface Call {
-
-
-	public String callMe();
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java
deleted file mode 100644
index 2fed64e..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java
deleted file mode 100644
index c5932c3..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/service/dependency/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.service.dependency.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 1196bc2..0000000
--- a/ipojo/tests/core/service-dependency/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,328 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml b/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
deleted file mode 100644
index e4e3a7f..0000000
--- a/ipojo/tests/core/service-dependency/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,1064 +0,0 @@
-<ipojo>
-<!--
-xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-  xmlns="org.apache.felix.ipojo"
- -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="FooProviderType-1" architecture="true">
-    <provides />
-  </component>
-
-  <!--  Simple Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="SimpleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="VoidCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ObjectCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="RefCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="BothCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-    <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="MapCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DictCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedSimpleCheckServiceProvider" architecture="true">
-    <requires field="fs" />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedVoidCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedObjectCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedRefCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedBothCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-    <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedMapCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedDictCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DoubleCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <requires field="fs" proxy="true"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedDoubleCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <requires field="fs" />
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MObjectCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MRefCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MBothCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MMapCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MDictCheckServiceProvider" architecture="true">
-    <requires>
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!-- Simple & Optional Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="SimpleOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" id="FooService" proxy="false"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false" />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="VoidOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ObjectOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="RefOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="RefOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="BothOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="MapOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DictOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedSimpleOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" id="FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedVoidOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedObjectOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedRefOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedBothOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedMapOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ProxiedDictOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="BothOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="MapOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DictOptionalNoNullableCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true" nullable="false">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MObjectOptionalCheckServiceProvider" architecture="true">
-    <requires optional="true">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MRefOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MBothOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MMapOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="MDictOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-
-  <!-- Simple & Optional Dependencies with default-implementation -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DISimpleOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl" />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIVoidOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIObjectOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIRefOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIBothOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIMapOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DIDictOptionalCheckServiceProvider" architecture="true">
-    <requires field="fs" optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="DIMObjectOptionalCheckServiceProvider" architecture="true">
-    <requires optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="DIMRefOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="DIMBothOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="DIMMapOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodCheckServiceProvider"
-    name="DIMDictOptionalCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      optional="true"
-      default-implementation="org.apache.felix.ipojo.test.scenarios.component.FooServiceDefaultImpl">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!--  Multiple Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="SimpleMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedSimpleMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" />
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="VoidMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedVoidMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ObjectMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedObjectMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="RefMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedRefMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="BothMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedBothMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="MapMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedMapMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="DictMultipleCheckServiceProvider" architecture="true" >
-    <requires field="fs" proxy="false">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedDictMultipleCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MObjectMultipleCheckServiceProvider" architecture="true">
-    <requires aggregate="true">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MRefMultipleCheckServiceProvider" architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      aggregate="true">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MBothMultipleCheckServiceProvider" architecture="true">
-    <requires aggregate="true">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MMapMultipleCheckServiceProvider" architecture="true">
-    <requires aggregate="true">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MDictMultipleCheckServiceProvider" architecture="true">
-    <requires aggregate="true">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!-- Multiple & Optional Dependencies -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="SimpleOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true" proxy="false"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="VoidOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ObjectOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="RefOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true" proxy="false">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedSimpleOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true" />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedVoidOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedObjectOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-    name="ProxiedRefOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires field="fs" optional="true">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MObjectOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires aggregate="true" optional="true">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.MethodMultipleCheckService"
-    name="MRefOptionalMultipleCheckServiceProvider"
-    architecture="true">
-    <requires
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"
-      aggregate="true" optional="true">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-    </requires>
-    <provides />
-  </component>
-
-  <!-- Aggregate dependency as List -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
-    name="SimpleListCheckServiceProvider" architecture="true">
-    <requires proxy="false"
-      field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
-    name="OptionalListCheckServiceProvider"
-    architecture="true">
-    <requires proxy="false"
-      specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
-    <provides />
-  </component>
-   <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
-    name="ProxiedSimpleListCheckServiceProvider" architecture="true">
-    <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.ListCheckService"
-    name="ProxiedOptionalListCheckServiceProvider"
-    architecture="true">
-    <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
-    <provides />
-  </component>
-
-  <!-- Aggregate dependency as Vector -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
-    name="SimpleVectorCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="objectBind"/>
-      <callback type="unbind" method="objectUnbind"/>
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.VectorCheckService"
-    name="OptionalVectorCheckServiceProvider"
-    architecture="true">
-    <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
-    <provides />
-  </component>
-
-  <!-- Aggregate dependency as Set -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
-    name="SimpleSetCheckServiceProvider" architecture="true">
-    <requires proxy="false" field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
-    name="OptionalSetCheckServiceProvider"
-    architecture="true">
-    <requires proxy="false" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
-    name="ProxiedSimpleSetCheckServiceProvider" architecture="true">
-    <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.SetCheckService"
-    name="ProxiedOptionalSetCheckServiceProvider"
-    architecture="true">
-    <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true" />
-    <provides />
-  </component>
-
-  <!-- Aggregate dependency as Collection -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
-    name="SimpleCollectionCheckServiceProvider" architecture="true">
-    <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" proxy="false"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
-    name="ProxiedSimpleCollectionCheckServiceProvider" architecture="true">
-    <requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService"/>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
-    name="OptionalCollectionCheckServiceProvider"
-    architecture="true">
-    <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true"
-      proxy="false"
-    />
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckService"
-    name="ProxiedOptionalCollectionCheckServiceProvider"
-    architecture="true">
-    <requires specification="org.apache.felix.ipojo.test.scenarios.service.dependency.service.FooService" field="fs" optional="true"
-      proxy="false"
-    />
-    <provides />
-  </component>
-
-
-  <!-- Modify method test -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType2"
-    name="FooProviderType-Updatable" architecture="true">
-    <provides>
-      <property name="foo" field="m_foo" value="foo"/>
-    </provides>
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="VoidModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="voidBind" />
-      <callback type="unbind" method="voidUnbind" />
-      <callback type="modified" method="voidModify"/>
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="ObjectModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="objectBind" />
-      <callback type="unbind" method="objectUnbind" />
-      <callback type="modified" method="objectModify" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="RefModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="refBind" />
-      <callback type="unbind" method="refUnbind" />
-      <callback type="modified" method="refModify" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="BothModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="bothBind" />
-      <callback type="unbind" method="bothUnbind" />
-      <callback type="modified" method="bothModify" />
-    </requires>
-    <provides />
-  </component>
-    <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="MapModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesMapBind" />
-      <callback type="unbind" method="propertiesMapUnbind" />
-      <callback type="modified" method="propertiesMapModify" />
-    </requires>
-    <provides />
-  </component>
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider"
-    name="DictModifyCheckServiceProvider" architecture="true">
-    <requires field="fs">
-      <callback type="bind" method="propertiesDictionaryBind" />
-      <callback type="unbind" method="propertiesDictionaryUnbind" />
-      <callback type="modified" method="propertiesDictionaryModify" />
-    </requires>
-    <provides />
-  </component>
-
-  <!--  Proxy Tests -->
-  <component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceDelegator">
-    <provides/>
-    <requires field="fs" optional="true"/>
-  </component>
-  <component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceGetAndDelegate">
-    <provides/>
-    <requires field="fs" optional="true"/>
-  </component>
-  <component classname="org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceNoDelegate">
-      <provides/>
-      <requires field="fs" optional="true"/>
-      <callback transition="validate" method="start"/>
-    <callback transition="invalidate" method="stop"/>
-  </component>
-
-  <component
-  	classname="org.apache.felix.ipojo.test.scenarios.service.dependency.proxy.CheckServiceUsingStringService"
-  	immediate="true">
-    <provides/>
-    <requires field="string"/>
-    <requires field="map"/>
-  </component>
-
-	<!-- Inner + Proxy mix -->
-  <component
-  	classname="org.apache.felix.ipojo.test.scenarios.component.inner.C1">
-  		<provides/>
-  </component>
-  <component
-  	classname="org.apache.felix.ipojo.test.scenarios.component.inner.C2">
-  		<provides specifications="org.apache.felix.ipojo.test.scenarios.component.inner.C2"/>
-		<requires field="c1"/>
-  </component>
-  <component
-  	classname="org.apache.felix.ipojo.test.scenarios.component.inner.C3">
-  		<provides specifications="org.apache.felix.ipojo.test.scenarios.component.inner.C3"/>
-		<requires field="c2"/>
-  </component>
-
-</ipojo>
diff --git a/ipojo/tests/core/service-providing-inheritance/pom.xml b/ipojo/tests/core/service-providing-inheritance/pom.xml
deleted file mode 100644
index 585cf54..0000000
--- a/ipojo/tests/core/service-providing-inheritance/pom.xml
+++ /dev/null
@@ -1,168 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.core.inheritance</artifactId>
-  <name>iPOJO Service Providing with inheritance Test Suite</name>
-  <version>${ipojo.core.snapshot}</version>
-  <description>The the service providing with inheritance</description>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-
-  <!-- Pax Exam API: -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <!--
-      During runtime Pax Exam will discover the OSGi container to use by
-      searching metadata available into classpath. Pax Exam comes with a
-      default container that uses [Pax Runner] for implementing the
-      container requirements:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-default
-          </artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <!--
-      If your test code is based on JUnit you will have to have the Junit
-      support artifact:
-    -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.5</version>
-      <type>jar</type>
-      <scope>test</scope>
-    </dependency>
-
-    <!--  TinyBundle -->
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-tinybundles</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.base</groupId>
-      <artifactId>ops4j-base</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-bnd</artifactId>
-      <version>1.2.0</version>
-      <scope>test</scope>
-    </dependency>
-
-    <!-- mockito -->
-    <dependency>
-      <groupId>org.mockito</groupId>
-      <artifactId>mockito-all</artifactId>
-      <version>1.7</version>
-      <scope>test</scope>
-    </dependency>
-
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>tinybundles-ipojo</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>osgi-helpers</artifactId>
-    </dependency>
-
-  <dependency>
-    <groupId>org.apache.felix</groupId>
-    <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-    <scope>compile</scope>
-  </dependency>
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-</project>
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/InheritanceTest.java b/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/InheritanceTest.java
deleted file mode 100644
index f6a2bd3..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/InheritanceTest.java
+++ /dev/null
@@ -1,161 +0,0 @@
-package org.apache.felix.ipojo.tests.inheritance;
-
-import static org.ops4j.pax.exam.CoreOptions.equinox;
-import static org.ops4j.pax.exam.CoreOptions.felix;
-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 static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.withBnd;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.handlers.dependency.DependencyDescription;
-import org.apache.felix.ipojo.handlers.dependency.DependencyHandlerDescription;
-import org.apache.felix.ipojo.tests.inheritance.a.IA;
-import org.apache.felix.ipojo.tests.inheritance.b.IB;
-import org.apache.felix.ipojo.tests.inheritance.c.C;
-import org.apache.felix.ipojo.tests.inheritance.d.D;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class InheritanceTest {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-
-        File tmp = new File("target/tmp");
-        tmp.mkdirs();
-
-        Option[] opt =  options(
-                felix(),
-                equinox(),
-                provision(
-                        // Runtime.
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                        ),
-                // Bundle A
-                provision(
-                        newBundle()
-                            .add( IA.class )
-                           .set(Constants.BUNDLE_SYMBOLICNAME,"A")
-                           .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.inheritance.a")
-                            .build( withBnd() )
-                    ),
-                // Bundle B
-                provision(
-                        newBundle()
-                            .add( IB.class )
-                           .set(Constants.BUNDLE_SYMBOLICNAME,"B")
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.inheritance.a")
-                           .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.tests.inheritance.b")
-                            .build( withBnd() )
-                    ),
-               // Bundle C and D : iPOJO Bundles
-               provision(
-                       // Component C
-                        newBundle()
-                            .add(C.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"C")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.inheritance.b," +
-                                        "org.apache.felix.ipojo.tests.inheritance.a")
-                           .build( withiPOJO(new File(tmp, "provider.jar"), new File("src/test/resources/provider.xml"))),
-                     // Component D
-                        newBundle()
-                            .add(D.class)
-                            .set(Constants.BUNDLE_SYMBOLICNAME,"D")
-                            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.tests.inheritance.b," +
-                                    "org.apache.felix.ipojo.tests.inheritance.a")
-                            .build( withiPOJO(new File(tmp, "cons.jar"), new File("src/test/resources/cons.xml"))))
-                );
-        return opt;
-    }
-
-    @Test
-    public void testDeploy() {
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            Assert.assertEquals(bundles[i].getSymbolicName() + " is not active", Bundle.ACTIVE, bundles[i].getState());
-        }
-
-        osgi.waitForService(Architecture.class.getName(), "(architecture.instance=c)", 2000);
-        osgi.waitForService(Architecture.class.getName(), "(architecture.instance=d)", 2000);
-
-        Object[] arch = osgi.getServiceObjects(Architecture.class.getName(), null);
-        for (Object o : arch) {
-            Architecture a = (Architecture) o;
-            if ( a.getInstanceDescription().getState() != ComponentInstance.VALID) {
-                Assert.fail("Instance " + a.getInstanceDescription().getName() + " not valid : " + a.getInstanceDescription().getDescription());
-            }
-        }
-    }
-
-    @Test
-    public void testArchitecture() {
-        osgi.waitForService(Architecture.class.getName(), "(architecture.instance=d)", 2000);
-        ServiceReference ref = ipojo.getServiceReferenceByName(Architecture.class.getName(), "d");
-        Assert.assertNotNull(ref);
-
-        Architecture arch = (Architecture) osgi.getServiceObject(ref);
-
-        System.out.println(arch.getInstanceDescription().getDescription());
-
-        Assert.assertEquals(ComponentInstance.VALID, arch.getInstanceDescription().getState());
-        DependencyDescription dd = getDependency(arch, "org.apache.felix.ipojo.tests.inheritance.b.IB");
-
-        Assert.assertTrue(! dd.getServiceReferences().isEmpty());
-
-        ServiceReference dref = (ServiceReference) dd.getServiceReferences().get(0);
-        Assert.assertEquals(dref.getBundle().getSymbolicName(), "C");
-
-    }
-
-    private DependencyDescription getDependency(Architecture arch, String id) {
-        DependencyHandlerDescription hd = (DependencyHandlerDescription) arch.getInstanceDescription().getHandlerDescription("org.apache.felix.ipojo:requires");
-        Assert.assertNotNull(hd);
-        for(DependencyDescription dd : hd.getDependencies()) {
-            if (dd.getId().equals(id)) { return dd; }
-        }
-        Assert.fail("Dependency " + id + " not found");
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/a/IA.java b/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/a/IA.java
deleted file mode 100644
index a224fd6..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/a/IA.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.tests.inheritance.a;
-
-public interface IA {
-    
-    public String methOne();
-
-}
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/b/IB.java b/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/b/IB.java
deleted file mode 100644
index 91185e2..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/b/IB.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package org.apache.felix.ipojo.tests.inheritance.b;
-
-import org.apache.felix.ipojo.tests.inheritance.a.IA;
-
-public interface IB extends IA {
-
-    public String methTwo();
-}
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/c/C.java b/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/c/C.java
deleted file mode 100644
index e1243d5..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/c/C.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.apache.felix.ipojo.tests.inheritance.c;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Provides;
-import org.apache.felix.ipojo.tests.inheritance.b.IB;
-
-@Component
-@Provides
-public class C implements IB {
-
-    public String methOne() { return "one";}
-    public String methTwo() { return "two";}
-
-}
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/d/D.java b/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/d/D.java
deleted file mode 100644
index b440cad..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/java/org/apache/felix/ipojo/tests/inheritance/d/D.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.apache.felix.ipojo.tests.inheritance.d;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.annotations.Validate;
-import org.apache.felix.ipojo.tests.inheritance.a.IA;
-import org.apache.felix.ipojo.tests.inheritance.b.IB;
-
-@Component
-public class D {
-    @Requires
-    private IB[] cImpls;
-    private IB cImplDesired;
-
-    // works if I use following instead and cast to C type below
-    // in for loop
-    // but this creates dependency on bundle C instead of just
-    // the interface bundles A & B
-    // @Requires(default-implementation=C)
-    // private iB[] cImpls;
-    // private C cImplDesired;
-
-    @Validate
-    public void start() {
-        for( IB iimpl : cImpls) {
-
-            // works just fine
-            System.out.println(iimpl.methTwo());
-
-            // following produces 
-            // invalid D instance with NoMethodFoundError
-            // unless I cast to C instead of iA
-            if( ((IA) iimpl).methOne().equals( "one")) {
-                cImplDesired = iimpl;
-                System.out.println(iimpl.methOne());
-            }
-        }
-    }
-}
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/resources/cons.xml b/ipojo/tests/core/service-providing-inheritance/src/test/resources/cons.xml
deleted file mode 100644
index 70a34c4..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/resources/cons.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo>
-<instance component="org.apache.felix.ipojo.tests.inheritance.d.D" name="d"/>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing-inheritance/src/test/resources/provider.xml b/ipojo/tests/core/service-providing-inheritance/src/test/resources/provider.xml
deleted file mode 100644
index bdc91ab..0000000
--- a/ipojo/tests/core/service-providing-inheritance/src/test/resources/provider.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo>
-<instance component="org.apache.felix.ipojo.tests.inheritance.c.C" name="c"/>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing-strategies/pom.xml b/ipojo/tests/core/service-providing-strategies/pom.xml
deleted file mode 100755
index 541a64f..0000000
--- a/ipojo/tests/core/service-providing-strategies/pom.xml
+++ /dev/null
@@ -1,112 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Providing Strategy Test Suite</name>
-  <artifactId>tests.core.ps.strategy</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <artifactId>tests.core.ps</artifactId>
-      <groupId>ipojo.tests</groupId>
-      <version>${project.version}</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test.scenarios.component.strategies, org.apache.felix.ipojo.test.scenarios.ps.strategies
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.ps.strategies.ProvidedServiceStrategyTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/BarConsumer.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/BarConsumer.java
deleted file mode 100644
index c7cf2d2..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/BarConsumer.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-
-public class BarConsumer implements CheckService {
-    
-    private BarService bs;
-
-
-    public boolean check() {
-        return bs.bar();
-    }
-
-    public Properties getProps() {
-        Properties props = bs.getProps();
-        props.put("object", bs);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/Consumer.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/Consumer.java
deleted file mode 100644
index 1479eb1..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/Consumer.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class Consumer implements CheckService {
-    
-    private FooService fs;
-
-
-    public boolean check() {
-        return fs.foo();
-    }
-
-    public Properties getProps() {
-        Properties props = fs.fooProps();
-        props.put("object", fs);
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy.java
deleted file mode 100644
index 5bc3838..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.IPOJOServiceFactory;
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.handlers.providedservice.CreationStrategy;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceRegistration;
-
-public class DummyCreationStrategy extends CreationStrategy implements InvocationHandler {
-
-    /**
-     * Map [ComponentInstance->ServiceObject] storing created service objects.
-     */
-    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();
-    
-    private InstanceManager m_manager;
-
-    private String[] m_specs;
-
-    /**
-     * A method is invoked on the proxy object.
-     * If the method is the {@link IPOJOServiceFactory#getService(ComponentInstance)} 
-     * method, this method creates a service object if no already created for the asking
-     * component instance. 
-     * If the method is {@link IPOJOServiceFactory#ungetService(ComponentInstance, Object)}
-     * the service object is unget (i.e. removed from the map and deleted).
-     * In all other cases, a {@link UnsupportedOperationException} is thrown as this policy
-     * requires to use  the {@link IPOJOServiceFactory} interaction pattern.  
-     * @param arg0 the proxy object
-     * @param arg1 the called method
-     * @param arg2 the arguments
-     * @return the service object attached to the asking instance for 'get', 
-     * <code>null</code> for 'unget',
-     * a {@link UnsupportedOperationException} for all other methods.
-     * @see java.lang.reflect.InvocationHandler#invoke(java.lang.Object, java.lang.reflect.Method, java.lang.Object[])
-     */
-    public Object invoke(Object arg0, Method arg1, Object[] arg2) {
-        if (isGetServiceMethod(arg1)) {
-            return getService((ComponentInstance) arg2[0]);
-        }
-        
-        if (isUngetServiceMethod(arg1)) {
-            ungetService((ComponentInstance) arg2[0], arg2[1]);
-            return null;
-        }
-        
-        throw new UnsupportedOperationException("This service requires an advanced creation policy. "
-                + "Before calling the service, call the getService(ComponentInstance) method to get "
-                + "the service object. " + arg1.getName()); 
-    }
-
-    /**
-     * A service object is required.
-     * This policy returns a service object per asking instance.
-     * @param instance the instance requiring the service object
-     * @return the service object for this instance
-     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)
-     */
-    public Object getService(ComponentInstance instance) {
-        Object obj = m_instances.get(instance);
-        if (obj == null) {
-            obj = m_manager.createPojoObject();
-            m_instances.put(instance, obj);
-        }
-        return obj;
-    }
-
-    /**
-     * A service object is unget.
-     * The service object is removed from the map and deleted.
-     * @param instance the instance releasing the service
-     * @param svcObject the service object
-     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, java.lang.Object)
-     */
-    public void ungetService(ComponentInstance instance, Object svcObject) {
-        Object pojo = m_instances.remove(instance);
-        m_manager.deletePojoObject(pojo);
-    }
-
-    /**
-     * The service is going to be registered.
-     * @param im the instance manager
-     * @param interfaces the published interfaces
-     * @param props the properties
-     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onPublication(org.osgi.framework.BundleContext, java.lang.String[], java.util.Properties)
-     */
-    public void onPublication(InstanceManager im, String[] interfaces,
-            Properties props) {
-        
-        m_manager = im;
-        m_specs = interfaces;
-        
-    }
-
-    /**
-     * The service is going to be unregistered.
-     * The instance map is cleared. Created object are disposed.
-     * @see org.apache.felix.ipojo.handlers.providedservice.CreationStrategy#onUnpublication()
-     */
-    public void onUnpublication() {
-        Collection col = m_instances.values();
-        Iterator it = col.iterator();
-        while (it.hasNext()) {
-            m_manager.deletePojoObject(it.next());
-        }
-        m_instances.clear();
-    }
-
-    /**
-     * OSGi Service Factory getService method.
-     * @param arg0 the asking bundle
-     * @param arg1 the service registration
-     * @return a proxy implementing the {@link IPOJOServiceFactory}
-     * @see org.osgi.framework.ServiceFactory#getService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration)
-     */
-    public Object getService(Bundle arg0, ServiceRegistration arg1) {
-        Object proxy = Proxy.newProxyInstance(m_manager.getClazz().getClassLoader(), 
-                getSpecificationsWithIPOJOServiceFactory(m_specs, m_manager.getContext()), this);
-        return proxy;
-    }
-
-    /**
-     * OSGi Service factory unget method.
-     * Does nothing.
-     * @param arg0 the asking bundle
-     * @param arg1 the service registration
-     * @param arg2 the service object created for this bundle.
-     * @see org.osgi.framework.ServiceFactory#ungetService(org.osgi.framework.Bundle, org.osgi.framework.ServiceRegistration, java.lang.Object)
-     */
-    public void ungetService(Bundle arg0, ServiceRegistration arg1,
-            Object arg2) { }
-    
-    /**
-     * Utility method returning the class array of provided service
-     * specification and the {@link IPOJOServiceFactory} interface.
-     * @param specs the published service interface
-     * @param bc the bundle context, used to load classes
-     * @return the class array containing provided service specification and
-     * the {@link IPOJOServiceFactory} class.
-     */
-    private Class[] getSpecificationsWithIPOJOServiceFactory(String[] specs, BundleContext bc) {
-        Class[] classes = new Class[specs.length + 1];
-        int i = 0;
-        for (i = 0; i < specs.length; i++) {
-            try {
-                classes[i] = bc.getBundle().loadClass(specs[i]);
-            } catch (ClassNotFoundException e) {
-                // Should not happen.
-            }
-        }
-        classes[i] = IPOJOServiceFactory.class;
-        return classes;
-    }
-    
-    
-}
-
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy2.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy2.java
deleted file mode 100644
index 8b2374f..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyCreationStrategy2.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import org.apache.felix.ipojo.IPOJOServiceFactory;
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.handlers.providedservice.strategy.ConfigurableCreationStrategy;
-
-public class DummyCreationStrategy2 extends ConfigurableCreationStrategy {
-
-	protected IPOJOServiceFactory getServiceFactory(InstanceManager manager) {
-		return new DummyServiceFactory(manager);
-	}
-    
-    
-}
-
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyServiceFactory.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyServiceFactory.java
deleted file mode 100644
index 3c9c24d..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/DummyServiceFactory.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.InstanceManager;
-import org.apache.felix.ipojo.handlers.providedservice.strategy.ServiceObjectFactory;
-
-public class DummyServiceFactory implements ServiceObjectFactory {
-
-    /**
-     * Map [ComponentInstance->ServiceObject] storing created service objects.
-     */
-    private Map/*<ComponentInstance, ServiceObject>*/ m_instances = new HashMap();
-    
-    private InstanceManager m_manager;
-
-    public DummyServiceFactory(InstanceManager manager) {
-        m_manager = manager;
-    }
-
-    /**
-     * A service object is required.
-     * This policy returns a service object per asking instance.
-     * @param instance the instance requiring the service object
-     * @return the service object for this instance
-     * @see org.apache.felix.ipojo.IPOJOServiceFactory#getService(org.apache.felix.ipojo.ComponentInstance)
-     */
-    public Object getService(ComponentInstance instance) {
-        Object obj = m_instances.get(instance);
-        if (obj == null) {
-            obj = m_manager.createPojoObject();
-            m_instances.put(instance, obj);
-        }
-        return obj;
-    }
-
-    /**
-     * A service object is unget.
-     * The service object is removed from the map and deleted.
-     * @param instance the instance releasing the service
-     * @param svcObject the service object
-     * @see org.apache.felix.ipojo.IPOJOServiceFactory#ungetService(org.apache.felix.ipojo.ComponentInstance, java.lang.Object)
-     */
-    public void ungetService(ComponentInstance instance, Object svcObject) {
-        Object pojo = m_instances.remove(instance);
-        m_manager.deletePojoObject(pojo);
-    }
-
-    public void close() {
-        Collection col = m_instances.values();
-        Iterator it = col.iterator();
-        while (it.hasNext()) {
-            m_manager.deletePojoObject(it.next());
-        }
-        m_instances.clear();
-    }
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooBarProviderType1.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooBarProviderType1.java
deleted file mode 100644
index be254c5..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooBarProviderType1.java
+++ /dev/null
@@ -1,86 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class FooBarProviderType1 implements FooService, BarService {
-    
-    public static long id = 0;
-    
-    public static long getNewId() {
-        id++;
-        return id;
-    }
-    
-    public static long getReturnedIds() {
-        return id;
-    }
-    
-    public static void resetIds() {
-        id = 0;
-    }
-	
-	private int m_bar;
-	private String m_foo;
-        
-    private long myid = getNewId();
-    
-    
-    
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-	    System.out.println(this + " - id : " + myid); //TODO DEBUG
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        
-        p.put("id", new Long(myid));
-		return p;
-	}
-    
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-    public boolean bar() {
-        return foo();
-    }
-
-    public Properties getProps() {
-        return fooProps();
-    }
-	
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooProviderType1.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooProviderType1.java
deleted file mode 100755
index 967a8de..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/component/strategies/FooProviderType1.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class FooProviderType1 implements FooService {
-    
-    public static long id = 0;
-    
-    public static long getNewId() {
-        id++;
-        return id;
-    }
-    
-    public static long getReturnedIds() {
-        return id;
-    }
-    
-    public static void resetIds() {
-        id = 0;
-    }
-	
-	private int m_bar;
-	private String m_foo;
-        
-    private long myid = getNewId();
-    
-    
-    
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-	    System.out.println(this + " - id : " + myid); //TODO DEBUG
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        
-        p.put("id", new Long(myid));
-		return p;
-	}
-    
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategy2Test.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategy2Test.java
deleted file mode 100644
index db6bf46..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategy2Test.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.ps.strategies;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-import java.util.Properties;
-
-public class CustomStrategy2Test extends OSGiTestCase {
-
-
-    private IPOJOHelper helper;
-    private ComponentInstance cons1, cons2, prov;
-    private ComponentInstance cons3, prov2;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        cons1 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
-        cons2 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
-        prov = helper.createComponentInstance("PSS-FooProviderType-Custom2");
-        prov2 = helper.createComponentInstance("PSS-FooBarProviderType-Custom2");
-        cons3 =  helper.createComponentInstance("PSS-ConsBar");
-        prov2.stop();
-        prov.stop();
-    }
-
-    public void tearDown() {
-        reset();
-    }
-
-
-    private void reset() {
-        FooProviderType1.resetIds();
-        FooBarProviderType1.resetIds();
-    }
-
-    private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    public void testOneService() {
-        prov.start();
-        cons2.stop();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
-        assertNotNull("Service available", ref);
-        checkCreatedObjects(prov, 0);
-
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov, 1);
-
-
-        // Step 2 : create a second consumer
-        cons2.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov, 2);
-
-
-        assertNotSame("Two objects", fscons1, fscons2);
-
-        // Step 3 : stop the second provider
-        System.out.println("cons2 stopping");
-        cons2.stop();
-        System.out.println("cons2 stopped");
-        checkCreatedObjects(prov, 1);
-
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-
-    public void testObjectCreation() {
-        prov.start();
-
-        // The two consumers are started and use their own objects.
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        FooService fscons1 = (FooService) props.get("object");
-
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        FooService fscons2 = (FooService) props2.get("object");
-
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons1, fscons2);
-
-        // Stop the provider
-        prov.stop();
-        // Cons1 and 2 are invalid.
-        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
-        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
-
-        // No object created in prov
-        checkCreatedObjects(prov, 0);
-
-        // Restart the provider
-        prov.start();
-
-        // Consumers are valid.
-        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
-        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
-
-        // Check objects
-        refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        cs_cons1 = (CheckService) getServiceObject(refcons1);
-        props = cs_cons1.getProps();
-        Object fscons3 = (FooService) props.get("object");
-
-        refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        cs_cons2 = (CheckService) getServiceObject(refcons2);
-        props2 = cs_cons2.getProps();
-        Object fscons4 = (FooService) props2.get("object");
-
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons3, fscons4);
-        assertNotSame("Two new objects - 1", fscons3, fscons1);
-        assertNotSame("Two new objects - 2", fscons4, fscons2);
-
-    }
-
-    public void testTwoServices() {
-        cons3.stop();
-        prov2.start();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", ref);
-        ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", refBar);
-        checkCreatedObjects(prov2, 0);
-
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov2, 1);
-
-
-        // Step 2 : create a second consumer
-        cons3.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov2, 2);
-
-
-        assertNotSame("Two objects", fscons1, fscons2);
-
-        // Step 3 : stop the second provider
-        cons3.stop();
-        checkCreatedObjects(prov2, 1);
-
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-
-}
\ No newline at end of file
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
deleted file mode 100644
index ec1a58c..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/CustomStrategyTest.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.ps.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CustomStrategyTest extends OSGiTestCase {
-    
-    
-    private IPOJOHelper helper;
-    private ComponentInstance cons1, cons2, prov;
-    private ComponentInstance cons3, prov2;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        cons1 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
-        cons2 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
-        prov = helper.createComponentInstance("PSS-FooProviderType-Custom");
-        prov2 = helper.createComponentInstance("PSS-FooBarProviderType-Custom");
-        cons3 =  helper.createComponentInstance("PSS-ConsBar");
-        prov2.stop();
-        prov.stop();
-    }
-    
-    public void tearDown() {
-        reset();
-    }
-    
-    
-    private void reset() {
-        FooProviderType1.resetIds();
-        FooBarProviderType1.resetIds();
-    }
-    
-    private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
-    }
-    
-    public void testOneService() {
-        prov.start();
-        cons2.stop();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
-        assertNotNull("Service available", ref);
-        checkCreatedObjects(prov, 0);
-        
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov, 1);
-
-        
-        // Step 2 : create a second consumer
-        cons2.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov, 2);
-
-        
-        assertNotSame("Two objects", fscons1, fscons2);
-        
-        // Step 3 : stop the second provider
-        System.out.println("cons2 stopping");
-        cons2.stop();
-        System.out.println("cons2 stopped");
-        checkCreatedObjects(prov, 1);
-        
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-    
-    public void testObjectCreation() {
-        prov.start();
-        
-        // The two consumers are started and use their own objects.
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        FooService fscons1 = (FooService) props.get("object");
-        
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        FooService fscons2 = (FooService) props2.get("object");
-        
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons1, fscons2);
-
-        // Stop the provider
-        prov.stop();
-        // Cons1 and 2 are invalid.
-        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
-        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
-        
-        // No object created in prov
-        checkCreatedObjects(prov, 0);
-
-        // Restart the provider
-        prov.start();
-        
-        // Consumers are valid.
-        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
-        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
-        
-        // Check objects
-        refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        cs_cons1 = (CheckService) getServiceObject(refcons1);
-        props = cs_cons1.getProps();
-        Object fscons3 = (FooService) props.get("object");
-        
-        refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        cs_cons2 = (CheckService) getServiceObject(refcons2);
-        props2 = cs_cons2.getProps();
-        Object fscons4 = (FooService) props2.get("object");
-        
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons3, fscons4);
-        assertNotSame("Two new objects - 1", fscons3, fscons1);
-        assertNotSame("Two new objects - 2", fscons4, fscons2);
-
-    }
-    
-    public void testTwoServices() {
-        cons3.stop();
-        prov2.start();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", ref);
-        ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", refBar);
-        checkCreatedObjects(prov2, 0);
-        
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov2, 1);
-
-        
-        // Step 2 : create a second consumer
-        cons3.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov2, 2);
-
-        
-        assertNotSame("Two objects", fscons1, fscons2);
-        
-        // Step 3 : stop the second provider
-        cons3.stop();
-        checkCreatedObjects(prov2, 1);
-        
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
deleted file mode 100644
index 5343ca9..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/PerInstanceStrategyTest.java
+++ /dev/null
@@ -1,201 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.ps.strategies;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1;
-import org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class PerInstanceStrategyTest extends OSGiTestCase {
-    
-    
-    private IPOJOHelper helper;
-    private ComponentInstance cons1, cons2, prov;
-    private ComponentInstance cons3, prov2;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        cons1 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons1 invalid", ComponentInstance.INVALID, cons1.getState());
-        cons2 = helper.createComponentInstance("PSS-Cons");
-        assertEquals("cons2 invalid", ComponentInstance.INVALID, cons2.getState());
-        prov = helper.createComponentInstance("PSS-FooProviderType-Instance");
-        prov2 = helper.createComponentInstance("PSS-FooBarProviderType-Instance");
-        cons3 =  helper.createComponentInstance("PSS-ConsBar");
-        prov2.stop();
-        prov.stop();
-    }
-    
-    public void tearDown() {
-        reset();
-    }
-    
-    
-    private void reset() {
-        FooProviderType1.resetIds();
-        FooBarProviderType1.resetIds();
-    }
-    
-    private void checkCreatedObjects(ComponentInstance ci, int expected) {
-        assertEquals("Number of created objects", expected, ((PrimitiveInstanceDescription) ci.getInstanceDescription()).getCreatedObjects().length);
-    }
-    
-    public void testOneService() {
-        prov.start();
-        cons2.stop();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov.getInstanceName());
-        assertNotNull("Service available", ref);
-        checkCreatedObjects(prov, 0);
-        
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov, 1);
-
-        
-        // Step 2 : create a second consumer
-        cons2.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov, 2);
-
-        
-        assertNotSame("Two objects", fscons1, fscons2);
-        
-        // Step 3 : stop the second provider
-        System.out.println("cons2 stopping");
-        cons2.stop();
-        System.out.println("cons2 stopped");
-        checkCreatedObjects(prov, 1);
-        
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-    
-    public void testObjectCreation() {
-        prov.start();
-        
-        // The two consumers are started and use their own objects.
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        FooService fscons1 = (FooService) props.get("object");
-        
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        FooService fscons2 = (FooService) props2.get("object");
-        
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons1, fscons2);
-
-        // Stop the provider
-        prov.stop();
-        // Cons1 and 2 are invalid.
-        assertEquals("Cons1 invalidity", ComponentInstance.INVALID, cons1.getState());
-        assertEquals("Cons2 invalidity", ComponentInstance.INVALID, cons2.getState());
-        
-        // No object created in prov
-        checkCreatedObjects(prov, 0);
-
-        // Restart the provider
-        prov.start();
-        
-        // Consumers are valid.
-        assertEquals("Cons1 validity", ComponentInstance.VALID, cons1.getState());
-        assertEquals("Cons2 validity", ComponentInstance.VALID, cons2.getState());
-        
-        // Check objects
-        refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        cs_cons1 = (CheckService) getServiceObject(refcons1);
-        props = cs_cons1.getProps();
-        Object fscons3 = (FooService) props.get("object");
-        
-        refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons2.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        cs_cons2 = (CheckService) getServiceObject(refcons2);
-        props2 = cs_cons2.getProps();
-        Object fscons4 = (FooService) props2.get("object");
-        
-        checkCreatedObjects(prov, 2);
-        assertNotSame("Two objects", fscons3, fscons4);
-        assertNotSame("Two new objects - 1", fscons3, fscons1);
-        assertNotSame("Two new objects - 2", fscons4, fscons2);
-
-    }
-    
-    public void testTwoServices() {
-        cons3.stop();
-        prov2.start();
-        cons1.stop();
-        assertEquals("Prov valid", ComponentInstance.VALID, prov2.getState());
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", ref);
-        ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), prov2.getInstanceName());
-        assertNotNull("Service available", refBar);
-        checkCreatedObjects(prov2, 0);
-        
-        // Step 1 : create start one consumer
-        cons1.start();
-        ServiceReference refcons1 = helper.getServiceReferenceByName(CheckService.class.getName(), cons1.getInstanceName());
-        assertNotNull("Cons1 Service available", refcons1);
-        
-        CheckService cs_cons1 = (CheckService) getServiceObject(refcons1);
-        Properties props = cs_cons1.getProps();
-        Long id = (Long) props.get("id");
-        FooService fscons1 = (FooService) props.get("object");
-        assertEquals("id 1", 1, id.intValue());
-        checkCreatedObjects(prov2, 1);
-
-        
-        // Step 2 : create a second consumer
-        cons3.start();
-        ServiceReference refcons2 = helper.getServiceReferenceByName(CheckService.class.getName(), cons3.getInstanceName());
-        assertNotNull("Cons2 Service available", refcons2);
-        
-        CheckService cs_cons2 = (CheckService) getServiceObject(refcons2);
-        Properties props2 = cs_cons2.getProps();
-        Long id2 = (Long) props2.get("id");
-        FooService fscons2 = (FooService) props2.get("object");
-        assertEquals("id 2", 2, id2.intValue());
-        checkCreatedObjects(prov2, 2);
-
-        
-        assertNotSame("Two objects", fscons1, fscons2);
-        
-        // Step 3 : stop the second provider
-        cons3.stop();
-        checkCreatedObjects(prov2, 1);
-        
-        // Step 4 : stop the first consumer
-        cons1.stop();
-        checkCreatedObjects(prov, 0);
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/ProvidedServiceStrategyTestSuite.java b/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/ProvidedServiceStrategyTestSuite.java
deleted file mode 100755
index 9b1a99d..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/strategies/ProvidedServiceStrategyTestSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.strategies;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ProvidedServiceStrategyTestSuite extends TestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Provided Service Strategy Test Suite", bc);
-		ots.addTestSuite(PerInstanceStrategyTest.class);
-		ots.addTestSuite(CustomStrategyTest.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing-strategies/src/main/resources/metadata.xml b/ipojo/tests/core/service-providing-strategies/src/main/resources/metadata.xml
deleted file mode 100755
index bb892b3..0000000
--- a/ipojo/tests/core/service-providing-strategies/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,58 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-  <!-- Simple provider  -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1"
-    name="PSS-FooProviderType-Instance" architecture="true">
-    <provides strategy="instance"/>
-  </component>
-  
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.strategies.Consumer"
-    name="PSS-Cons" architecture="true">
-    <requires field="fs" proxy="false"/>
-    <provides/>
-  </component>
-  
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.strategies.BarConsumer"
-    name="PSS-ConsBar" architecture="true">
-    <requires field="bs" proxy="false"/>
-    <provides/>
-  </component>
-  
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1"
-    name="PSS-FooBarProviderType-Instance" architecture="true">
-    <provides strategy="instance"/>
-  </component>
-  
-    <component
-        classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1"
-        name="PSS-FooProviderType-Custom" architecture="true">
-        <provides strategy="org.apache.felix.ipojo.test.scenarios.component.strategies.DummyCreationStrategy"/>
-    </component>
-
-    <component
-        classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1"
-        name="PSS-FooBarProviderType-Custom" architecture="true">
-        <provides strategy="org.apache.felix.ipojo.test.scenarios.component.strategies.DummyCreationStrategy"/>
-    </component>
-
-    <component
-        classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooProviderType1"
-        name="PSS-FooProviderType-Custom2" architecture="true">
-        <provides strategy="org.apache.felix.ipojo.test.scenarios.component.strategies.DummyCreationStrategy2"/>
-    </component>
-
-    <component
-        classname="org.apache.felix.ipojo.test.scenarios.component.strategies.FooBarProviderType1"
-        name="PSS-FooBarProviderType-Custom2" architecture="true">
-        <provides strategy="org.apache.felix.ipojo.test.scenarios.component.strategies.DummyCreationStrategy2"/>
-    </component>
-
-
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/pom.xml b/ipojo/tests/core/service-providing/pom.xml
deleted file mode 100644
index 98e150c..0000000
--- a/ipojo/tests/core/service-providing/pom.xml
+++ /dev/null
@@ -1,137 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Service Providing Test Suite</name>
-  <artifactId>tests.core.ps</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.core.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.ps.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.ps.ProvidedServiceTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-        <dependencies>
-          <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-          </dependency>
-        </dependencies>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-
-       <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/README b/ipojo/tests/core/service-providing/src/main/ipojo/README
deleted file mode 100644
index 657bcef..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/README
+++ /dev/null
@@ -1 +0,0 @@
-This folder contains the iPOJO metadata.
\ No newline at end of file
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/basics.xml b/ipojo/tests/core/service-providing/src/main/ipojo/basics.xml
deleted file mode 100644
index 5816366..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/basics.xml
+++ /dev/null
@@ -1,121 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="org.apache.felix.ipojo"
->
-    <!-- Simple provider  -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-     name="PS-FooProviderType-1" architecture="true">
-        <provides/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-     name="PS-FooProviderType-itf" architecture="true">
-        <provides
-         specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-     name="PS-FooProviderType-3" architecture="true">
-        <provides>
-            <property name="foo" field="m_foo"/>
-            <property name="bar" field="m_bar"/>
-            <property name="baz" type="java.lang.String"/>
-        </provides>
-        <properties propagation="true">
-            <property name="foo" field="m_foo"/>
-            <property name="bar" field="m_bar"/>
-        </properties>
-    </component>
-
-    <!-- Providers providing 2 services -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
-     name="PS-FooBarProviderType-1" architecture="true">
-        <provides/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
-     name="PS-FooBarProviderType-2" architecture="true">
-        <provides
-         specifications="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService, org.apache.felix.ipojo.test.scenarios.ps.service.BarService }"/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
-     name="PS-FooBarProviderType-3" architecture="true">
-        <provides
-         specifications="{org.apache.felix.ipojo.test.scenarios.ps.service.FooService}">
-            <property name="baz" type="java.lang.String" value="foo"/>
-        </provides>
-        <provides
-         specifications="{org.apache.felix.ipojo.test.scenarios.ps.service.BarService}">
-            <property name="baz" type="java.lang.String" value="bar"/>
-        </provides>
-    </component>
-
-
-    <!-- Provider with dynamic property -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-     name="PS-FooProviderType-Dyn" architecture="true">
-        <provides>
-            <property name="int" field="intProp" value="2"/>
-            <property name="boolean" field="boolProp" value="false"/>
-            <property name="string" field="strProp" value="foo"/>
-            <property name="strAProp" field="strAProp"
-             value="{foo, bar}"/>
-            <property name="intAProp" field="intAProp" value="{1,2,3}"/>
-        </provides>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-     name="PS-FooProviderType-2" architecture="true">
-        <provides>
-            <property name="int" type="int" value="2"/>
-            <property name="long" type="long" value="40"/>
-            <property name="string" type="java.lang.String" value="foo"/>
-            <property name="strAProp" type="java.lang.String[]"
-             value="{foo, bar}"/>
-            <property name="intAProp" type="int[]" value="{1,2,3}"/>
-        </provides>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn2"
-     name="PS-FooProviderType-Dyn2" architecture="true">
-        <provides>
-            <property name="int" field="intProp" value="4"/>
-            <property name="boolean" field="boolProp"/>
-            <property name="string" field="strProp"/>
-            <property name="strAProp" field="strAProp"/>
-            <property name="intAProp" field="intAProp"
-             value="{1, 2,3 }"/>
-        </provides>
-    </component>
-
-    <!--  Null Check -->
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.NullCheckServiceProvider" immediate="true"
-     name="PS-Null">
-        <provides>
-            <property field="prop1"/>
-            <property field="prop2"/>
-        </provides>
-    </component>
-
-    <!-- Anonymous classes -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderWithAnonymousClass"
-     name="PS-FooProviderTypeAnonymous-Dyn" architecture="true">
-        <provides>
-            <property name="int" field="intProp" value="2"/>
-            <property name="boolean" field="boolProp" value="false"/>
-            <property name="string" field="strProp" value="foo"/>
-            <property name="strAProp" field="strAProp"
-             value="{foo, bar}"/>
-            <property name="intAProp" field="intAProp" value="{1,2,3}"/>
-        </provides>
-    </component>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/callbacks/callbacks.xml b/ipojo/tests/core/service-providing/src/main/ipojo/callbacks/callbacks.xml
deleted file mode 100644
index 7963170..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/callbacks/callbacks.xml
+++ /dev/null
@@ -1,41 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="org.apache.felix.ipojo"
->
-    <!-- Registration callbacks -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.callbacks.CallbacksCheckService"
-     name="PS-Callbacks-reg-only">
-        <provides post-registration="registered"/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.callbacks.CallbacksCheckService"
-     name="PS-Callbacks-both">
-        <provides post-registration="registered" post-unregistration="unregistered"/>
-    </component>
-	<component
-     classname="org.apache.felix.ipojo.test.scenarios.component.callbacks.CallbacksCheckService"
-     name="PS-Callbacks-unreg-only">
-        <provides post-unregistration="unregistered"/>
-    </component>
-	<component
-     classname="org.apache.felix.ipojo.test.scenarios.component.callbacks.CallbacksCheckService"
-     name="PS-Callbacks-both-2">
-        <provides
-			specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"
-			post-unregistration="unregistered" post-registration="registered"/>
-		<provides
-			specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService"
-			post-unregistration="unregistered2" post-registration="registered2"/>
-    </component>
-	<component
-     classname="org.apache.felix.ipojo.test.scenarios.component.callbacks.CallbacksCheckService"
-     name="PS-Callbacks-both-1">
-        <provides
-			specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"
-			post-unregistration="unregistered" post-registration="registered"/>
-		<provides
-			specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService"
-			post-unregistration="unregistered" post-registration="registered"/>
-    </component>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/concrete-abstract.xml b/ipojo/tests/core/service-providing/src/main/ipojo/concrete-abstract.xml
deleted file mode 100644
index 843e17a..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/concrete-abstract.xml
+++ /dev/null
@@ -1,33 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="org.apache.felix.ipojo"
->
-
-    <!-- Concrete and abstract class -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation"
-     name="PS-PI4" architecture="true">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation"/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
-     name="PS-PI5" architecture="true">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation"/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation4"
-     name="PS-PI6" architecture="true">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation"/>
-    </component>
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation3"
-     name="PS-PI7" architecture="true">
-        <provides specifications="[org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation, org.apache.felix.ipojo.test.scenarios.ps.service.FooService]"/>
-    </component>
-
-	<component
-	classname="org.apache.felix.ipojo.test.scenarios.component.SimpleClass">
-		<provides/>
-	</component>
-
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/controller/service-controller.xml b/ipojo/tests/core/service-providing/src/main/ipojo/controller/service-controller.xml
deleted file mode 100644
index bff80f4..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/controller/service-controller.xml
+++ /dev/null
@@ -1,86 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="org.apache.felix.ipojo"
->
-    <!--  Service Controller -->
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.ControllerCheckService"
-     name="PS-Controller-1-default">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">
-            <controller field="controller"/>
-        </provides>
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">
-        </provides>
-    </component>
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.ControllerCheckService"
-     name="PS-Controller-1-false">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controller" value="false"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">
-        </provides>
-    </component>
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-truetrue">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="true"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">
-            <controller field="controllerCS" value="true"/>
-        </provides>
-    </component>
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-truefalse">
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.FooService">
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="false"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-        <provides specifications="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService">
-            <controller field="controllerCS" value="true"/>
-        </provides>
-    </component>
-
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-spec1">
-        <provides>
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="false" specification="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"/>
-            <controller field="controllerCS" value="true" specification="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-    </component>
-
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-spec2">
-        <provides>
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="true" specification="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"/>
-            <controller field="controllerCS" value="true" specification="org.apache.felix.ipojo.test.scenarios.ps.service.CheckService"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-    </component>
-
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-spec3">
-        <provides>
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="true" specification="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"/>
-            <controller field="controllerCS" value="true"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-    </component>
-
-    <component classname="org.apache.felix.ipojo.test.scenarios.component.controller.DoubleControllerCheckService"
-     name="PS-Controller-2-spec4">
-        <provides>
-            <property name="test2" type="string" value="test2"/>
-            <controller field="controllerFoo" value="false" specification="org.apache.felix.ipojo.test.scenarios.ps.service.FooService"/>
-            <controller field="controllerCS" value="true"/>
-            <property name="test" type="string" value="test"/>
-        </provides>
-    </component>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/src/main/ipojo/inheritance/inheritance.xml b/ipojo/tests/core/service-providing/src/main/ipojo/inheritance/inheritance.xml
deleted file mode 100644
index dd103ac..0000000
--- a/ipojo/tests/core/service-providing/src/main/ipojo/inheritance/inheritance.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<ipojo
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns="org.apache.felix.ipojo"
->
-
-    <!--  Inherited Provides -->
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
-     name="PS-PI1" architecture="true">
-        <provides/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
-     name="PS-PI1-1" architecture="true">
-        <provides
-         specifications="org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface"/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation1"
-     name="PS-PI1-2" architecture="true">
-        <provides
-         specifications="{org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface, org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface2}"/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
-     name="PS-PI2" architecture="true">
-        <provides/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation2"
-     name="PS-PI2-1" architecture="true">
-        <provides
-         specifications="org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface"/>
-    </component>
-
-    <component
-     classname="org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessImplementation3"
-     name="PS-PI3" architecture="true">
-        <provides/>
-    </component>
-</ipojo>
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
deleted file mode 100644
index cef0891..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckProviderParentClass.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public abstract class CheckProviderParentClass {
-    
-    int simpleU = 0;
-    int objectU = 0;
-    int refU = 0;
-    int bothU = 0;
-    
-    
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if(sr != null && o != null && o instanceof FooService) { bothU++; }
-    }
-    
-    public void refUnbind(ServiceReference sr) {
-        if(sr != null) { refU++; }
-    }
-    
-    public void objectUnbind(FooService o) {
-        if(o != null && o instanceof FooService) { objectU++; }
-        else {
-            System.err.println("Unbind null : " + o);
-        }
-    }
-    
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index a41f977..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CheckServiceProvider extends CheckProviderParentClass implements CheckService {
-    
-	FooService fs;
-	
-	int simpleB = 0;
-	int objectB = 0;
-	int refB = 0;
-	int bothB = 0;
-
-	public boolean check() {
-		return fs.foo();
-	}
-
-	public Properties getProps() {
-		Properties props = new Properties();
-		props.put("voidB", new Integer(simpleB));
-		props.put("objectB", new Integer(objectB));
-		props.put("refB", new Integer(refB));
-		props.put("bothB", new Integer(bothB));
-		props.put("voidU", new Integer(simpleU));
-		props.put("objectU", new Integer(objectU));
-		props.put("refU", new Integer(refU));
-		props.put("bothU", new Integer(bothU));
-		if (fs != null) {
-		    props.put("result", new Boolean(fs.foo()));
-		    props.put("boolean", new Boolean(fs.getBoolean()));
-		    props.put("int", new Integer(fs.getInt()));
-		    props.put("long", new Long(fs.getLong()));
-		    props.put("double", new Double(fs.getDouble()));
-		    if(fs.getObject() != null) { props.put("object", fs.getObject()); }
-		}
-        props.put("static", CheckService.foo);
-        props.put("class", CheckService.class.getName());
-		return props;
-	}
-	
-	private void voidBind() {
-		simpleB++;
-	}
-	
-	protected void objectBind(FooService o) {
-	    if (o == null) {
-	        System.err.println("Bind receive null !!! ");
-	        return;
-	    }
-		if(o != null && o instanceof FooService) { objectB++; }
-	}
-	
-	public void refBind(ServiceReference sr) {
-		if(sr != null) { refB++; }
-	}
-	
-    public void bothBind(FooService o, ServiceReference sr) {
-	    if(sr != null && o != null && o instanceof FooService) { bothB++; }
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
deleted file mode 100644
index 5fbac9f..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class FooBarProviderType1 implements FooService, BarService {
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		return new Properties();
-	}
-
-	public boolean bar() {
-		return true;
-	}
-
-	public Properties getProps() {
-		return new Properties();
-	}
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index cac57b2..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
deleted file mode 100644
index a83cd7a..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-
-public class FooProviderTypeDyn implements FooService {
-	
-	private int intProp;	
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-
-	public boolean foo() {
-		intProp = 3;
-		boolProp = true;
-		if(strProp.equals("foo")) { strProp = "bar"; }
-		else { strProp = "foo"; }
-		strAProp = new String[] {"foo", "bar", "baz"};
-		intAProp = new int[] {3, 2, 1};
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
deleted file mode 100644
index 40f6698..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn2.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class FooProviderTypeDyn2 implements FooService {
-	
-	private int intProp = 2;
-	private boolean boolProp = true;
-	private String strProp = "foo";
-	private String[] strAProp = new String[] {"foo", "bar"};
-	private int[] intAProp = new int[] {1, 2, 3};
-
-	public boolean foo() {
-		intAProp = null;
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderWithAnonymousClass.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderWithAnonymousClass.java
deleted file mode 100644
index 351871c..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderWithAnonymousClass.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import javax.swing.SwingUtilities;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class FooProviderWithAnonymousClass implements FooService {
-
-	private int intProp;
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-
-	public boolean foo() {
-		Runnable runnable = new Runnable() {
-			public void run() {
-				intProp = 3;
-				boolProp = true;
-				if(strProp.equals("foo")) { strProp = "bar"; }
-				else { strProp = "foo"; }
-				strAProp = new String[] {"foo", "bar", "baz"};
-				intAProp = new int[] {3, 2, 1};
-			}
-		};
-		new Thread(runnable).start();
-
-		try {
-			Thread.sleep(500);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-
-	public boolean getBoolean() {
-		SwingUtilities.invokeLater(new Runnable() {
-			public void run() {
-				intProp = 3;
-				boolProp = true;
-				if(strProp.equals("foo")) { strProp = "bar"; }
-				else { strProp = "foo"; }
-				strAProp = new String[] {"foo", "bar", "baz"};
-				intAProp = new int[] {3, 2, 1};
-			}
-		});
-
-		try {
-			Thread.sleep(500);
-		} catch (InterruptedException e) {
-			e.printStackTrace();
-		}
-
-		return true;
-	}
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullCheckServiceProvider.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullCheckServiceProvider.java
deleted file mode 100644
index ee775b3..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullCheckServiceProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class NullCheckServiceProvider implements FooService {
-    
-    private String prop1;
-    private String prop2;
-    
-    public NullCheckServiceProvider() {
-      if (prop1 == null) {
-          prop2= "0";
-      }
-    }
-    
-
-    public boolean foo() {
-        if (prop1 == null  && prop2 != null) {
-            prop1 = "0";
-            prop2 = null;
-            return true;
-        }
-        if (prop2 == null  && prop1 != null) {
-            prop1 = null;
-            prop2 = "0";
-            return true;
-        }
-        return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleClass.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleClass.java
deleted file mode 100644
index 5761947..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SimpleClass.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class SimpleClass {
-
-	// This class do not implement any interface, it will be exposed as SimpleClass
-
-	public String hello() {
-		return "Hello";
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/callbacks/CallbacksCheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/callbacks/CallbacksCheckService.java
deleted file mode 100644
index 56b6b6e..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/callbacks/CallbacksCheckService.java
+++ /dev/null
@@ -1,92 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.callbacks;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class CallbacksCheckService implements FooService, CheckService {
-
-	// 4 Counters
-	int registered = 0;
-	int unregistered = 0;
-	int registered2 = 0;
-	int unregistered2 = 0;
-
-	// 4 Methods
-	public void registered(ServiceReference ref) {
-		if (ref == null) {
-			throw new IllegalArgumentException("ref null");
-		}
-		registered++;
-	}
-
-	public void unregistered(ServiceReference ref) {
-		if (ref == null) {
-			throw new IllegalArgumentException("ref null");
-		}
-		unregistered++;
-	}
-
-	public void registered2(ServiceReference ref) {
-		if (ref == null) {
-			throw new IllegalArgumentException("ref null");
-		}
-		registered2++;
-	}
-
-	public void unregistered2(ServiceReference ref) {
-		if (ref == null) {
-			throw new IllegalArgumentException("ref null");
-		}
-		unregistered2++;
-	}
-
-    public boolean foo() {
-        return true;
-    }
-
-    public Properties fooProps() {
-        Properties props = new Properties();
-        props.put("registered", new Integer(registered));
-        props.put("registered2", new Integer(registered2));
-        props.put("unregistered", new Integer(unregistered));
-        props.put("unregistered2", new Integer(unregistered2));
-        return props;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean check() {
-       return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("registered", new Integer(registered));
-        props.put("registered2", new Integer(registered2));
-        props.put("unregistered", new Integer(unregistered));
-        props.put("unregistered2", new Integer(unregistered2));
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java
deleted file mode 100644
index 988294f..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/ControllerCheckService.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.controller;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class ControllerCheckService implements FooService, CheckService {
-    
-    
-    private boolean controller;
-
-    public boolean foo() {
-        return controller;
-    }
-
-    public Properties fooProps() {
-        Properties props = new Properties();
-        props.put("controller", new Boolean(controller));
-        return props;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean check() {
-        System.out.println("Before : " + controller);
-        controller = ! controller; // Change
-        System.out.println("After : " + controller);
-        return controller;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("controller", new Boolean(controller));
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java
deleted file mode 100644
index bdfa92c..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/controller/DoubleControllerCheckService.java
+++ /dev/null
@@ -1,66 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component.controller;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class DoubleControllerCheckService implements FooService, CheckService {
-    
-    
-    private boolean controllerFoo;
-    private boolean controllerCS;
-
-    public boolean foo() {
-        controllerFoo = ! controllerFoo;
-        return controllerFoo;
-    }
-
-    public Properties fooProps() {
-        Properties props = new Properties();
-        props.put("controller", new Boolean(controllerFoo));
-        
-        controllerCS = true;
-        controllerFoo = true;
-        
-        return props;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-    public boolean check() {
-        controllerCS = ! controllerCS;
-        return controllerCS;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("controller", new Boolean(controllerCS));
-        
-        // Invert both
-        controllerCS = ! controllerCS;
-        controllerFoo = ! controllerFoo;
-        
-        return props;
-        
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
deleted file mode 100644
index 46488a8..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation1.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.inherited;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
-
-public class ProcessImplementation1 implements ChildInterface {
-
-    public void processChild() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent1() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParentParent() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent2() {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
deleted file mode 100644
index 49e9267..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation2.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.inherited;
-
-
-public class ProcessImplementation2 extends ProcessParentImplementation {
-
-    public void processChild() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent1() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParentParent() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent2() {
-        // TODO Auto-generated method stub
-
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
deleted file mode 100644
index d59adbd..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation3.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.inherited;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class ProcessImplementation3 extends ProcessParentImplementation  implements FooService {
-
-    public void processChild() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent1() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParentParent() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent2() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean foo() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public Properties fooProps() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public boolean getBoolean() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public double getDouble() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public int getInt() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public long getLong() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public Boolean getObject() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation4.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation4.java
deleted file mode 100644
index d6066de..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessImplementation4.java
+++ /dev/null
@@ -1,82 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.inherited;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class ProcessImplementation4 extends ProcessImplementation2  implements FooService {
-
-    public void processChild() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent1() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParentParent() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public void processParent2() {
-        // TODO Auto-generated method stub
-
-    }
-
-    public boolean foo() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public Properties fooProps() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public boolean getBoolean() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public double getDouble() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public int getInt() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public long getLong() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public Boolean getObject() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
deleted file mode 100644
index 4872be4..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/component/inherited/ProcessParentImplementation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.inherited;
-
-import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
-
-public class ProcessParentImplementation implements ChildInterface {
-
-    public void processChild() {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void processParent1() {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void processParentParent() {
-        // TODO Auto-generated method stub
-        
-    }
-
-    public void processParent2() {
-        // TODO Auto-generated method stub
-        
-    }
-
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/CallbacksTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/CallbacksTest.java
deleted file mode 100644
index d5ef6b9..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/CallbacksTest.java
+++ /dev/null
@@ -1,177 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class CallbacksTest extends OSGiTestCase {
-
-    IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-
-
-    public void tearDown() {
-        helper.dispose();
-    }
-
-    public void testWithPostRegistrationOnly() {
-    	ComponentInstance ci = helper.createComponentInstance("PS-Callbacks-reg-only");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-
-        Integer reg = (Integer) check.getProps().get("registered");
-        Integer unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(0), unreg);
-
-        ci.stop();
-
-        reg = (Integer) check.getProps().get("registered");
-        unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(0), unreg);
-    }
-
-    public void testWithBoth() {
-    	ComponentInstance ci = helper.createComponentInstance("PS-Callbacks-both");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-
-        Integer reg = (Integer) check.getProps().get("registered");
-        Integer unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(0), unreg);
-
-        ci.stop();
-
-        reg = (Integer) check.getProps().get("registered");
-        unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(1), unreg);
-    }
-
-    public void testWithPostUnregistrationOnly() {
-    	ComponentInstance ci = helper.createComponentInstance("PS-Callbacks-unreg-only");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-
-        Integer reg = (Integer) check.getProps().get("registered");
-        Integer unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(0), reg);
-        assertEquals(new Integer(0), unreg);
-
-        ci.stop();
-
-        reg = (Integer) check.getProps().get("registered");
-        unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(0), reg);
-        assertEquals(new Integer(1), unreg);
-    }
-
-    public void testWithTwoPairsOfCallbacks() {
-    	ComponentInstance ci = helper.createComponentInstance("PS-Callbacks-both-2");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-
-        Integer reg = (Integer) check.getProps().get("registered");
-        Integer unreg = (Integer) check.getProps().get("unregistered");
-        Integer reg2 = (Integer) check.getProps().get("registered2");
-        Integer unreg2 = (Integer) check.getProps().get("unregistered2");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertNotNull(reg2);
-        assertNotNull(unreg2);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(0), unreg);
-        assertEquals(new Integer(1), reg2);
-        assertEquals(new Integer(0), unreg2);
-
-        ci.stop();
-
-        reg = (Integer) check.getProps().get("registered");
-        unreg = (Integer) check.getProps().get("unregistered");
-        reg2 = (Integer) check.getProps().get("registered2");
-        unreg2 = (Integer) check.getProps().get("unregistered2");
-        assertNotNull(reg2);
-        assertNotNull(unreg2);
-        assertEquals(new Integer(1), reg);
-        assertEquals(new Integer(1), unreg);
-        assertEquals(new Integer(1), reg2);
-        assertEquals(new Integer(1), unreg2);
-    }
-
-    public void testWithOnePairForTwoService() {
-    	ComponentInstance ci = helper.createComponentInstance("PS-Callbacks-both-1");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-
-        Integer reg = (Integer) check.getProps().get("registered");
-        Integer unreg = (Integer) check.getProps().get("unregistered");
-        assertNotNull(reg);
-        assertNotNull(unreg);
-        assertEquals(new Integer(2), reg);
-        assertEquals(new Integer(0), unreg);
-
-        ci.stop();
-
-        reg = (Integer) check.getProps().get("registered");
-        unreg = (Integer) check.getProps().get("unregistered");
-        assertEquals(new Integer(2), reg);
-        assertEquals(new Integer(2), unreg);
-    }
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ClassTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ClassTest.java
deleted file mode 100644
index de241b9..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ClassTest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class ClassTest extends OSGiTestCase {
-    
-    private Factory pi4, pi5, pi6, pi7;
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        pi4 = helper.getFactory("PS-PI4");
-        pi5 = helper.getFactory("PS-PI5");
-        pi6 = helper.getFactory("PS-PI6");
-        pi7 = helper.getFactory("PS-PI7");
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-    
-    
-    public void testIP4() {
-       helper.createComponentInstance( pi4.getName(), "ci");
-        
-       ServiceReference ref1 = helper.getServiceReferenceByName("org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation", "ci");
-       assertNotNull("Check itself", ref1);
-        
-       ProcessParentImplementation itself = (ProcessParentImplementation) getServiceObject(ref1);
-       
-        itself.processChild();
-    }
-    
-    public void testIP5() {
-        helper.createComponentInstance( pi5.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName("org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation", "ci");
-        assertNotNull("Check parent", ref1);
-         
-        ProcessParentImplementation itself = (ProcessParentImplementation) getServiceObject(ref1);
-        
-         itself.processChild();
-        
-    }
-    
-    public void testIP6() {
-        helper.createComponentInstance( pi6.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName("org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation", "ci");
-        assertNotNull("Check parent-parent", ref1);
-         
-        ProcessParentImplementation itself = (ProcessParentImplementation) getServiceObject(ref1);
-        
-         itself.processChild();
-    }
-    
-    public void testIP7() {
-       helper.createComponentInstance( pi7.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName("org.apache.felix.ipojo.test.scenarios.component.inherited.ProcessParentImplementation", "ci");
-        assertNotNull("Check parent-parent", ref1);
-         
-        ProcessParentImplementation itself = (ProcessParentImplementation) getServiceObject(ref1);
-        
-         itself.processChild();
-         
-         ServiceReference ref5 = helper.getServiceReferenceByName( FooService.class.getName(), "ci");
-         assertNotNull("Check FS", ref5);
-    }
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
deleted file mode 100644
index fd351b9..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicProps.java
+++ /dev/null
@@ -1,267 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class DynamicProps extends OSGiTestCase {
-	
-	IPOJOHelper helper;
-
-	public void setUp() {
-	    helper = new IPOJOHelper(this);
-		String type = "PS-FooProviderType-Dyn";
-		helper.createComponentInstance(type, "FooProvider-1");
-		
-		Properties p2 = new Properties();
-		p2.put("instance.name","FooProvider-2");
-		p2.put("int", new Integer(4));
-		p2.put("boolean", new Boolean(false));
-		p2.put("string", new String("bar"));
-		p2.put("strAProp", new String[] {"bar", "foo"});
-		p2.put("intAProp", new int[] {1, 2, 3});
-		helper.createComponentInstance(type, p2);
-		
-		String type2 = "PS-FooProviderType-Dyn2";
-		Properties p3 = new Properties();
-		p3.put("instance.name","FooProvider-3");
-		p3.put("int", new Integer(0));
-		p3.put("boolean", new Boolean(true));
-		p3.put("string", new String(""));
-		p3.put("strAProp", new String[0]);
-		p3.put("intAProp", new int[0]);
-		helper.createComponentInstance(type2, p3);
-		
-        Properties p4 = new Properties();
-        p4.put("instance.name","FooProvider-4");
-        helper.createComponentInstance(type2, p4);
-		
-	}
-	
-	public void tearDown() {
-		helper.dispose();
-	}
-	
-	public void testProperties1() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
-		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity (1)", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1)"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1)"); }
-		}
-		
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-		
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality (2)", intProp, new Integer(3));
-		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity (2)", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
-		}
-		assertNotNull("Check intAProp not nullity (2)", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2)"); }
-		}
-		
-		fs = null;
-	}
-	
-	public void testProperties2() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-2");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(4));
-		assertEquals("Check longProp equality", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"bar", "foo"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-		
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(3));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		fs = null;
-	}
-	
-	public void testProperties3() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(0));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String(""));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[0];
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[0];
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-		
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNull("Check intAProp hidding (no value)", intAProp);
-		
-		fs = null;
-	}
-
-    public void testProperties4() {
-    	ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-4");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	Integer intProp = (Integer) sr.getProperty("int");
-    	Object boolProp = sr.getProperty("boolean");
-    	Object strProp = sr.getProperty("string");
-    	Object strAProp = sr.getProperty("strAProp");
-    	int[] intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(4)); // Set by the component type.
-    	assertEquals("Check boolProp equality", boolProp, null);
-    	assertEquals("Check strProp equality", strProp, null);
-    	assertNull("Check strAProp  nullity", strAProp);
-    	assertNotNull("Check intAProp not nullity", intAProp); // Set by the component type.
-    	assertNotNull("Check intAProp not nullity", intAProp);
-        int[] v2 = new int[] {1, 2, 3};
-        for (int i = 0; i < intAProp.length; i++) {
-            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-        }
-    	
-    	// Invoke
-    	FooService fs = (FooService) getServiceObject(sr);
-    	assertTrue("invoke fs", fs.foo());
-    	
-    	// Re-check the property (change)
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(2));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	String[] v = new String[] {"foo", "bar"};
-    	for (int i = 0; i < ((String[]) strAProp).length; i++) {
-    		if(! ((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNull("Check intAProp hidding (no value)", intAProp);
-    	
-    	fs = null;    
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
deleted file mode 100644
index 680d4d2..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/DynamicPropsReconfiguration.java
+++ /dev/null
@@ -1,699 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class DynamicPropsReconfiguration extends OSGiTestCase {
-	ComponentInstance fooProvider3, fooProvider4;
-	
-	IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);		
-		String type2 = "PS-FooProviderType-Dyn2";
-		Properties p3 = new Properties();
-		p3.put("instance.name","FooProvider-3");
-		p3.put("int", new Integer(0));
-		p3.put("boolean", new Boolean(true));
-		p3.put("string", new String(""));
-		p3.put("strAProp", new String[0]);
-		p3.put("intAProp", new int[0]);
-		fooProvider3 = helper.createComponentInstance(type2, p3);
-		
-        fooProvider4 = helper.createComponentInstance(type2, "FooProvider-4");
-	}
-	
-	public void tearDown() {
-		helper.dispose();
-	}
-	
-	public void testFactoryReconf() {
-    	ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	Integer intProp = (Integer) sr.getProperty("int");
-    	Boolean boolProp = (Boolean) sr.getProperty("boolean");
-    	String strProp = (String) sr.getProperty("string");
-    	String[] strAProp = (String[]) sr.getProperty("strAProp");
-    	int[] intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(0));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String(""));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	String[] v = new String[0];
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	int[] v2 = new int[0];
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}
-    	
-    	// Reconfiguration
-    	ServiceReference fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-    	Factory fact = (Factory) getServiceObject(fact_ref);
-    	Properties p3 = new Properties();
-    	p3.put("instance.name","FooProvider-3");
-    	p3.put("int", new Integer(1));
-    	p3.put("boolean", new Boolean(true));
-    	p3.put("string", new String("foo"));
-    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-    	p3.put("intAProp", new int[] { 1, 2, 3});
-    	try {
-    		fact.reconfigure(p3);
-    	} catch(Exception e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	// Invoke
-    	FooService fs = (FooService) getServiceObject(sr);
-    	assertTrue("invoke fs", fs.foo());
-    	
-    	// Re-check the property (change)
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(2));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNull("Check intAProp hidding (no value)", intAProp);
-    	
-    	//	Reconfiguration
-    	fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-    	fact = (Factory) getServiceObject(fact_ref);
-    	p3 = new Properties();
-    	p3.put("instance.name","FooProvider-3");
-    	p3.put("int", new Integer(1));
-    	p3.put("boolean", new Boolean(true));
-    	p3.put("string", new String("foo"));
-    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-    	p3.put("intAProp", new int[] { 1, 2, 3});
-    	try {
-    		fact.reconfigure(p3);
-    	} catch(Exception e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	fact = null;
-    	fs = null;
-    }
-
-    public void testFactoryReconfString() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(0));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String(""));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[0];
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[0];
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-		Factory fact = (Factory) getServiceObject(fact_ref);
-		Properties p3 = new Properties();
-		p3.put("instance.name","FooProvider-3");
-		p3.put("int", "1");
-		p3.put("boolean", "true");
-		p3.put("string", "foo");
-		p3.put("strAProp", "{foo, bar, baz}");
-		p3.put("intAProp", "{1, 2, 3}");
-		try {
-			fact.reconfigure(p3);
-		} catch(Exception e) {
-			fail("Unable to reconfigure the instance with : " + p3);
-		}
-		
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(1));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] { 1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}	
-		
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-		
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNull("Check intAProp hidding (no value)", intAProp);
-		
-		//	Reconfiguration
-		fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-		fact = (Factory) getServiceObject(fact_ref);
-		p3 = new Properties();
-		p3.put("instance.name","FooProvider-3");
-		p3.put("int", "1");
-		p3.put("boolean", "true");
-		p3.put("string", "foo");
-		p3.put("strAProp", "{foo, bar, baz}");
-		p3.put("intAProp", "{ 1, 2, 3}");
-		try {
-			fact.reconfigure(p3);
-		} catch(Exception e) {
-			fail("Unable to reconfigure the instance with : " + p3);
-		}
-		
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(1));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] { 1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}	
-		
-		fact = null;
-		fs = null;
-	}
-	
-	public void testMSFReconf() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(0));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String(""));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[0];
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[0];
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName(ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
-		ManagedServiceFactory fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-		Properties p3 = new Properties();
-		p3.put("int", new Integer(1));
-		p3.put("boolean", new Boolean(true));
-		p3.put("string", new String("foo"));
-		p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-		p3.put("intAProp", new int[] { 1, 2, 3});
-		try {
-			fact.updated("FooProvider-3", p3);
-		} catch (ConfigurationException e) {
-			fail("Unable to reconfigure the instance with : " + p3);
-		}
-		
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(1));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] { 1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}	
-		
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-		
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNull("Check intAProp hidding (no value)", intAProp);
-		
-		//	Reconfiguration
-		fact_ref = helper.getServiceReferenceByName(ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
-		fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-		p3 = new Properties();
-		p3.put("int", new Integer(1));
-		p3.put("boolean", new Boolean(true));
-		p3.put("string", new String("foo"));
-		p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-		p3.put("intAProp", new int[] { 1, 2, 3});
-		try {
-			fact.updated("FooProvider-3", p3);
-		} catch (ConfigurationException e) {
-			fail("Unable to reconfigure the instance with : " + p3);
-		}
-		
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(1));
-		assertEquals("Check longProp equality", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] { 1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}	
-		
-		fact = null;
-		fs = null;
-	}
-
-    public void testMSFReconfString() {
-    	ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	Integer intProp = (Integer) sr.getProperty("int");
-    	Boolean boolProp = (Boolean) sr.getProperty("boolean");
-    	String strProp = (String) sr.getProperty("string");
-    	String[] strAProp = (String[]) sr.getProperty("strAProp");
-    	int[] intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(0));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String(""));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	String[] v = new String[0];
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	int[] v2 = new int[0];
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}
-    	
-    	// Reconfiguration
-    	ServiceReference fact_ref = helper.getServiceReferenceByName(ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
-    	ManagedServiceFactory fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-    	Properties p3 = new Properties();
-    	p3.put("int", "1");
-    	p3.put("boolean", "true");
-    	p3.put("string", "foo");
-    	p3.put("strAProp", "{foo, bar, baz}");
-    	p3.put("intAProp", "{ 1, 2, 3}");
-    	try {
-    		fact.updated("FooProvider-3", p3);
-    	} catch (ConfigurationException e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	// Invoke
-    	FooService fs = (FooService) getServiceObject(sr);
-    	assertTrue("invoke fs", fs.foo());
-    	
-    	// Re-check the property (change)
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(2));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNull("Check intAProp hidding (no value)", intAProp);
-    	
-    	//	Reconfiguration
-    	fact_ref = helper.getServiceReferenceByName(ManagedServiceFactory.class.getName() , "PS-FooProviderType-Dyn2");
-    	fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-    	p3 = new Properties();
-    	p3.put("int", "1");
-        p3.put("boolean", "true");
-        p3.put("string", "foo");
-        p3.put("strAProp", "{foo, bar, baz}");
-        p3.put("intAProp", "{ 1, 2, 3}");
-    	try {
-    		fact.updated("FooProvider-3", p3);
-    	} catch (ConfigurationException e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < strAProp.length; i++) {
-    		if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	fact = null;
-    	fs = null;
-    }
-
-    public void testFactoryReconfNoValue() {
-    	ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-4");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	Integer intProp = (Integer) sr.getProperty("int");
-    	Object boolProp = sr.getProperty("boolean");
-    	Object strProp = sr.getProperty("string");
-    	Object strAProp = sr.getProperty("strAProp");
-    	int[] intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(4));
-    	assertEquals("Check longProp equality", boolProp, null);
-    	assertEquals("Check strProp equality", strProp, null);
-    	assertNull("Check strAProp nullity", strAProp);
-    	
-    	assertNotNull("Check intAProp not nullity", intAProp);
-        int[] v2 = new int[] {1, 2, 3};
-        for (int i = 0; i < intAProp.length; i++) {
-            if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-        }
-    	
-    	// Reconfiguration
-    	ServiceReference fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-    	Factory fact = (Factory) getServiceObject(fact_ref);
-    	Properties p3 = new Properties();
-    	p3.put("instance.name","FooProvider-4");
-    	p3.put("int", new Integer(1));
-    	p3.put("boolean", new Boolean(true));
-    	p3.put("string", new String("foo"));
-    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-    	p3.put("intAProp", new int[] { 1, 2, 3});
-    	try {
-    		fact.reconfigure(p3);
-    	} catch(Exception e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-4");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	String[] v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < ((String[]) strAProp).length; i++) {
-    		if(! ((String[])strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	// Invoke
-    	FooService fs = (FooService) getServiceObject(sr);
-    	assertTrue("invoke fs", fs.foo());
-    	
-    	// Re-check the property (change)
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(2));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar"};
-    	for (int i = 0; i < ((String[]) strAProp).length; i++) {
-    		if(!((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNull("Check intAProp hidding (no value)", intAProp);
-    	
-    	//	Reconfiguration
-    	fact_ref = helper.getServiceReferenceByName(Factory.class.getName() , "PS-FooProviderType-Dyn2");
-    	fact = (Factory) getServiceObject(fact_ref);
-    	p3 = new Properties();
-    	p3.put("instance.name","FooProvider-3");
-    	p3.put("int", new Integer(1));
-    	p3.put("boolean", new Boolean(true));
-    	p3.put("string", new String("foo"));
-    	p3.put("strAProp", new String[] {"foo", "bar", "baz"});
-    	p3.put("intAProp", new int[] { 1, 2, 3});
-    	try {
-    		fact.reconfigure(p3);
-    	} catch(Exception e) {
-    		fail("Unable to reconfigure the instance with : " + p3);
-    	}
-    	
-    	sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-3");
-    	assertNotNull("Check the availability of the FS service", sr);
-    	
-    	// Check service properties
-    	intProp = (Integer) sr.getProperty("int");
-    	boolProp = (Boolean) sr.getProperty("boolean");
-    	strProp = (String) sr.getProperty("string");
-    	strAProp = (String[]) sr.getProperty("strAProp");
-    	intAProp = (int[]) sr.getProperty("intAProp");
-    	
-    	assertEquals("Check intProp equality", intProp, new Integer(1));
-    	assertEquals("Check longProp equality", boolProp, new Boolean(true));
-    	assertEquals("Check strProp equality", strProp, new String("foo"));
-    	assertNotNull("Check strAProp not nullity", strAProp);
-    	v = new String[] {"foo", "bar", "baz"};
-    	for (int i = 0; i < ((String[])strAProp).length; i++) {
-    		if(!((String[]) strAProp)[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-    	}
-    	assertNotNull("Check intAProp not nullity", intAProp);
-    	v2 = new int[] { 1, 2, 3};
-    	for (int i = 0; i < intAProp.length; i++) {
-    		if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-    	}	
-    	
-    	fact = null;
-    	fs = null;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java
deleted file mode 100644
index d888e61..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/Exposition.java
+++ /dev/null
@@ -1,167 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class Exposition extends OSGiTestCase {
-	
-	private ComponentInstance fooProviderSimple;
-	private ComponentInstance fooProviderItf;
-	private ComponentInstance fooBarProvider;
-	private ComponentInstance fooBarProvider2;
-	private ComponentInstance fooBarProvider3;
-	
-	private IPOJOHelper helper;
-	
-	public void setUp(){ 
-	    helper = new IPOJOHelper(this);
-		fooProviderSimple = helper.createComponentInstance("PS-FooProviderType-1", "fooProviderSimple");
-		
-		fooProviderItf = helper.createComponentInstance("PS-FooProviderType-itf", "fooProviderItf");
-		
-		fooBarProvider = helper.createComponentInstance("PS-FooBarProviderType-1", "fooProviderItfs");
-		
-		fooBarProvider2 = helper.createComponentInstance("PS-FooBarProviderType-2", "fooProviderItfs2");
-		
-		fooBarProvider3 = helper.createComponentInstance("PS-FooBarProviderType-3", "fooProviderItfs3");
-		
-		assertNotNull("Check the instance creation of fooProviderSimple", fooProviderSimple);
-		assertNotNull("Check the instance creation of fooProviderItf", fooProviderItf);
-		assertNotNull("Check the instance creation of fooProviderItfs", fooBarProvider);
-		assertNotNull("Check the instance creation of fooProviderItfs2", fooBarProvider2);
-		assertNotNull("Check the instance creation of fooProviderItfs3", fooBarProvider3);
-		
-	}
-	
-	public void tearDown() {
-	    helper.dispose();	
-	}
-	
-	public void testSimpleExposition() {
-		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), fooProviderSimple.getInstanceName());
-		assertNotNull("Check the availability of the FS from "+fooProviderSimple.getInstanceName(), ref);
-		FooService fs = (FooService) getServiceObject(ref);
-		assertTrue("Check fs invocation", fs.foo());
-		fs = null;
-		fooProviderSimple.stop();
-		ref = helper.getServiceReferenceByName(FooService.class.getName(), fooProviderSimple.getInstanceName());
-		assertNull("Check the absence of the FS from "+fooProviderSimple.getInstanceName(), ref);
-		
-	}
-	
-	public void testItfExposition() {
-		ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), fooProviderItf.getInstanceName());
-		assertNotNull("Check the availability of the FS from "+fooProviderItf.getInstanceName(), ref);
-		FooService fs = (FooService) getServiceObject(ref);
-		assertTrue("Check fs invocation", fs.foo());
-		fs = null;
-		fooProviderItf.stop();
-		
-		ref = helper.getServiceReferenceByName(FooService.class.getName(), fooProviderItf.getInstanceName());
-		assertNull("Check the absence of the FS from "+fooProviderItf.getInstanceName(), ref);
-	}
-	
-	public void testItfsExposition() {
-		ServiceReference refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider.getInstanceName());
-		assertNotNull("Check the availability of the FS from "+fooBarProvider.getInstanceName(), refFoo);
-		ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider.getInstanceName());
-		assertNotNull("Check the availability of the BS from "+fooBarProvider.getInstanceName(), refBar);
-		
-		assertSame("Check service reference equality", refFoo, refBar);
-		
-		FooService fs = (FooService) getServiceObject(refFoo);
-		assertTrue("Check fs invocation", fs.foo());
-		fs = null;
-		
-		BarService bs = (BarService) getServiceObject(refBar);
-		assertTrue("Check bs invocation", bs.bar());
-		bs = null;
-		
-		fooBarProvider.stop();
-		
-		refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider.getInstanceName());
-		refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider.getInstanceName());
-		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
-		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
-	}
-	
-	public void testItfsExposition2() {
-		ServiceReference refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider2.getInstanceName());
-		assertNotNull("Check the availability of the FS from "+fooBarProvider2.getInstanceName(), refFoo);
-		ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider2.getInstanceName());
-		assertNotNull("Check the availability of the BS from "+fooBarProvider2.getInstanceName(), refBar);
-		
-		assertSame("Check service reference equality", refFoo, refBar);
-		
-		FooService fs = (FooService) getServiceObject(refFoo);
-		assertTrue("Check fs invocation", fs.foo());
-		fs = null;
-		
-		BarService bs = (BarService) getServiceObject(refBar);
-		assertTrue("Check bs invocation", bs.bar());
-		bs = null;
-		
-		fooBarProvider2.stop();
-		
-		refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider2.getInstanceName());
-		refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider2.getInstanceName());
-		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
-		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
-	}
-	
-	public void testItfsExposition3() {
-		ServiceReference refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider3.getInstanceName());
-		assertNotNull("Check the availability of the FS from "+fooBarProvider3.getInstanceName(), refFoo);
-		ServiceReference refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider3.getInstanceName());
-		assertNotNull("Check the availability of the BS from "+fooBarProvider3.getInstanceName(), refBar);
-		
-		assertNotSame("Check service reference inequality", refFoo, refBar);
-		
-		FooService fs = (FooService) getServiceObject(refFoo);
-		assertTrue("Check fs invocation", fs.foo());
-		fs = null;
-		
-		BarService bs = (BarService) getServiceObject(refBar);
-		assertTrue("Check bs invocation", bs.bar());
-		bs = null;
-		
-		// Check properties
-		String baz1 = (String) refFoo.getProperty("baz");
-		String baz2 = (String) refBar.getProperty("baz");
-		
-		assertEquals("Check Baz Property 1", baz1, "foo");
-		assertEquals("Check Baz Property 2", baz2, "bar");
-		
-		fooBarProvider3.stop();
-		
-		refFoo = helper.getServiceReferenceByName(FooService.class.getName(), fooBarProvider3.getInstanceName());
-		refBar = helper.getServiceReferenceByName(BarService.class.getName(), fooBarProvider3.getInstanceName());
-		assertNull("Check the absence of the FS from "+fooBarProvider.getInstanceName(), refFoo);
-		assertNull("Check the absence of the BS from "+fooBarProvider.getInstanceName(), refBar);
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java
deleted file mode 100644
index 41777ea..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/InheritedTest.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.ChildInterface;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface1;
-import org.apache.felix.ipojo.test.scenarios.ps.service.ParentInterface2;
-import org.apache.felix.ipojo.test.scenarios.ps.service.ParentParentInterface;
-import org.osgi.framework.ServiceReference;
-
-public class InheritedTest extends OSGiTestCase {
-    
-    private Factory pi1, pi11, pi12, pi2, pi21, pi3;
-    
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        pi1 = helper.getFactory("PS-PI1");
-        pi11 = helper.getFactory("PS-PI1-1");
-        pi12 = helper.getFactory("PS-PI1-2");
-        
-        pi2 = helper.getFactory("PS-PI2");
-        pi21 = helper.getFactory("PS-PI2-1");
-        
-        pi3 = helper.getFactory("PS-PI3");
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-    
-    private boolean contains(String[] arr, String txt) {
-        for (int i = 0; i < arr.length; i++) {
-            if (arr[i].equals(txt)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public void testPI1Factory() {
-        String[] specs = pi1.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count", specs.length, 4);
-        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));
-        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));
-        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-    }
-    
-    public void testPI11Factory() {
-        String[] specs = pi11.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count", specs.length, 1);
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-    }
-    
-    public void testPI12Factory() {
-        String[] specs = pi12.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count", specs.length, 2);
-        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-    }
-    
-    public void testPI2Factory() {
-        String[] specs = pi2.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count ("+specs.length+")", specs.length, 4);
-        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));
-        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));
-        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-    }
-    
-    public void testPI21Factory() {
-        String[] specs = pi21.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count", specs.length, 1);
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-    }
-    
-    public void testPI3Factory() {
-        String[] specs = pi3.getComponentDescription().getprovidedServiceSpecification();
-        assertEquals("Check provides count", specs.length, 5);
-        assertTrue("Check Child", contains(specs, ChildInterface.class.getName()));
-        assertTrue("Check Parent1", contains(specs, ParentInterface1.class.getName()));
-        assertTrue("Check Parent2", contains(specs, ParentInterface2.class.getName()));
-        assertTrue("Check ParentParent", contains(specs, ParentParentInterface.class.getName()));
-        assertTrue("Check FS", contains(specs, FooService.class.getName()));
-    }
-    
-    public void testIP1() {
-        ComponentInstance ci = helper.createComponentInstance( pi1.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName( ChildInterface.class.getName(), "ci");
-        assertNotNull("Check Child", ref1);
-        
-        ServiceReference ref2 = helper.getServiceReferenceByName( ParentInterface1.class.getName(), "ci");
-        assertNotNull("Check Parent1", ref2);
-        
-        ServiceReference ref3 = helper.getServiceReferenceByName( ParentInterface2.class.getName(), "ci");
-        assertNotNull("Check Parent2", ref3);
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ci.dispose();
-    }
-    
-    public void testIP11() {
-        ComponentInstance ci = helper.createComponentInstance( pi11.getName(), "ci");
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ci.dispose();
-    }
-    
-    public void testIP12() {
-        ComponentInstance ci = helper.createComponentInstance( pi12.getName(), "ci");
-        
-        ServiceReference ref3 = helper.getServiceReferenceByName( ParentInterface2.class.getName(), "ci");
-        assertNotNull("Check Parent2", ref3);
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ci.dispose();
-    }
-    
-    public void testIP2() {
-        ComponentInstance ci = helper.createComponentInstance( pi2.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName( ChildInterface.class.getName(), "ci");
-        assertNotNull("Check Child", ref1);
-        
-        ServiceReference ref2 = helper.getServiceReferenceByName( ParentInterface1.class.getName(), "ci");
-        assertNotNull("Check Parent1", ref2);
-        
-        ServiceReference ref3 = helper.getServiceReferenceByName( ParentInterface2.class.getName(), "ci");
-        assertNotNull("Check Parent2", ref3);
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ci.dispose();
-    }
-    
-    public void testIP21() {
-        ComponentInstance ci = helper.createComponentInstance( pi21.getName(), "ci");
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ci.dispose();
-    }
-    
-    public void testIP3() {
-        ComponentInstance ci = helper.createComponentInstance( pi3.getName(), "ci");
-        
-        ServiceReference ref1 = helper.getServiceReferenceByName( ChildInterface.class.getName(), "ci");
-        assertNotNull("Check Child", ref1);
-        
-        ServiceReference ref2 = helper.getServiceReferenceByName( ParentInterface1.class.getName(), "ci");
-        assertNotNull("Check Parent1", ref2);
-        
-        ServiceReference ref3 = helper.getServiceReferenceByName( ParentInterface2.class.getName(), "ci");
-        assertNotNull("Check Parent2", ref3);
-        
-        ServiceReference ref4 = helper.getServiceReferenceByName( ParentParentInterface.class.getName(), "ci");
-        assertNotNull("Check PP", ref4);
-        
-        ServiceReference ref5 = helper.getServiceReferenceByName( FooService.class.getName(), "ci");
-        assertNotNull("Check FS", ref5);
-        
-        ci.dispose();
-    }
-    
-    
-    
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/NullCheck.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/NullCheck.java
deleted file mode 100644
index 9466f33..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/NullCheck.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class NullCheck extends OSGiTestCase {
-    
-    public void testNull() {
-        IPOJOHelper helper = new IPOJOHelper(this);
-        
-        String factName = "PS-Null";
-        String compName = "NullCheck";
-        ServiceReference ref = null;
-        
-        // Check that no Foo Service are available
-        ref = getServiceReference(FooService.class.getName());
-        assertNull("FS already available", ref);
-    
-        // Get the factory to create a component instance
-        Factory fact = helper.getFactory(factName);
-        assertNotNull("Cannot find the factory FooProvider-1", fact);
-        
-        // Don't give any configuration so, properties are null.
-        helper.createComponentInstance(factName, compName);
-        
-        // Get a FooService provider
-        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
-
-        assertNotNull("FS not available", ref);
-        
-        // Check service properties
-        assertNull(ref.getProperty("prop1"));
-        assertNotNull(ref.getProperty("prop2"));
-        
-        // Test foo invocation
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("FooService invocation failed", fs.foo());
-        
-        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
-        // Check service properties
-        assertNotNull(ref.getProperty("prop1"));
-        assertNull(ref.getProperty("prop2"));
-
-        
-        helper.dispose();
-
-        
-        // Check that there is no more FooService
-        ref = getServiceReference(FooService.class.getName(), null);
-        
-        
-        assertNull("FS available, but component instance stopped", ref);
-        
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/OSGiPropertiesTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/OSGiPropertiesTest.java
deleted file mode 100644
index 4ddbac9..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/OSGiPropertiesTest.java
+++ /dev/null
@@ -1,84 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-
-public class OSGiPropertiesTest extends OSGiTestCase {
-    
-    public void testOSGiProperties() {
-        IPOJOHelper helper = new IPOJOHelper(this);
-        
-        String factName = "PS-FooProviderType-1";
-        String compName = "FooProvider-1";
-        ServiceReference ref = null;
-        
-        // Check that no Foo Service are available
-        ref = getServiceReference(FooService.class.getName());
-        
-        assertNull("FS already available", ref);
-    
-        // Get the factory to create a component instance
-        Factory fact = helper.getFactory(factName);
-        assertNotNull("Cannot find the factory FooProvider-1", fact);
-        
-        Dictionary conf = new Properties();
-        conf.put(Constants.SERVICE_DESCRIPTION, "description");
-        conf.put(Constants.SERVICE_RANKING, "10");
-        conf.put(Constants.SERVICE_VENDOR, "ASF");
-        conf.put(Constants.SERVICE_PID, "my.pid");
-        
-        helper.createComponentInstance(factName, compName, conf);
-        
-        // Get a FooService provider
-        ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
-
-        assertNotNull("FS not available", ref);
-        
-        // Check properties
-        assertEquals("description", ref.getProperty(Constants.SERVICE_DESCRIPTION));
-        assertEquals(new Integer(10), ref.getProperty(Constants.SERVICE_RANKING));
-        assertEquals("ASF", ref.getProperty(Constants.SERVICE_VENDOR));
-        assertEquals("my.pid", ref.getProperty(Constants.SERVICE_PID));
-        
-        
-        // Test foo invocation
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("FooService invocation failed", fs.foo());
-        
-        helper.dispose();
-
-        
-        // Check that there is no more FooService
-        ref = getServiceReference(FooService.class.getName(), null);
-        
-        
-        assertNull("FS available, but component instance stopped", ref);
-        
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/PropertiesInAnonymousClassTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/PropertiesInAnonymousClassTest.java
deleted file mode 100644
index d40599e..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/PropertiesInAnonymousClassTest.java
+++ /dev/null
@@ -1,131 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class PropertiesInAnonymousClassTest extends OSGiTestCase {
-
-	IPOJOHelper helper;
-
-	public void setUp() {
-	    helper = new IPOJOHelper(this);
-		String type = "PS-FooProviderTypeAnonymous-Dyn";
-		helper.createComponentInstance(type, "FooProviderAno-1");
-
-	}
-
-	public void tearDown() {
-		helper.dispose();
-	}
-
-	public void testRunnable() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
-		assertNotNull("Check the availability of the FS service", sr);
-
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-
-		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
-		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity (1)", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1)"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1)"); }
-		}
-
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.foo());
-
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-
-		assertEquals("Check intProp equality (2)", intProp, new Integer(3));
-		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity (2)", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
-		}
-		assertNotNull("Check intAProp not nullity (2)", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2)"); }
-		}
-
-		fs = null;
-	}
-
-	public void testSwingWorker() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
-		assertNotNull("Check the availability of the FS service", sr);
-
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Boolean boolProp = (Boolean) sr.getProperty("boolean");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-
-		assertEquals("Check intProp equality (1)", intProp, new Integer(2));
-		assertEquals("Check longProp equality (1)", boolProp, new Boolean(false));
-		assertEquals("Check strProp equality (1)", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity (1)", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (1)"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (1)"); }
-		}
-
-		// Invoke
-		FooService fs = (FooService) getServiceObject(sr);
-		assertTrue("invoke fs", fs.getBoolean());
-
-		sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProviderAno-1");
-		// Re-check the property (change)
-		intProp = (Integer) sr.getProperty("int");
-		boolProp = (Boolean) sr.getProperty("boolean");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-
-		assertEquals("Check intProp equality (2)", intProp, new Integer(3));
-		assertEquals("Check longProp equality (2)", boolProp, new Boolean(true));
-		assertEquals("Check strProp equality (2)", strProp, new String("bar"));
-		assertNotNull("Check strAProp not nullity (2)", strAProp);
-		v = new String[] {"foo", "bar", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality (2)"); }
-		}
-		assertNotNull("Check intAProp not nullity (2)", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality (2)"); }
-		}
-
-		fs = null;
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
deleted file mode 100644
index 6476b1f..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceArchitectureTest.java
+++ /dev/null
@@ -1,235 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.HandlerDescription;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription;
-import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class ProvidedServiceArchitectureTest extends OSGiTestCase {
-	
-    private IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-	
-	public void testExposition() {
-		String factName = "PS-FooProviderType-1";
-		String compName = "FooProvider-1";
-		
-		// Get the factory to create a component instance
-		Factory fact = helper.getFactory( factName);
-		assertNotNull("Cannot find the factory FooProvider-1", fact);
-
-		helper.createComponentInstance(factName, compName);
-
-		ServiceReference arch_ref = helper.getServiceReferenceByName(Architecture.class.getName(), compName);		
-		assertNotNull("Architecture not available", arch_ref);
-
-		Architecture arch = (Architecture) getServiceObject(arch_ref);
-		InstanceDescription id = arch.getInstanceDescription();
-		
-		assertEquals("Check component instance name (" + id.getName() + ")", id.getName(), compName);
-		assertEquals("Check component type implementation class", id.getComponentDescription().getClassName(), "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-		
-		HandlerDescription[] handlers = id.getHandlers();
-		assertEquals("Number of handlers", handlers.length, 2);
-		
-		//Look for the ProvidedService Handler
-		ProvidedServiceHandlerDescription pshd = null;
-        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
-
-//		for(int i = 0; i < handlers.length; i++) {
-//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-//				pshd = (ProvidedServiceHandlerDescription) handlers[i];
-//			}
-//		}
-//		
-		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
-		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
-		
-		assertEquals("Check ProvidedService number", ps.length, 1);
-		assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecifications().length, 1);
-		assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[0], FooService.class.getName());
-		assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);
-		Properties prop = ps[0].getProperties();
-		assertNotNull("Check Props", prop);
-		assertEquals("Check service properties number", prop.size(), 2);
-		assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);
-		assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);
-	}
-	
-	public void testProps() {
-		String factName = "PS-FooProviderType-3";
-		String compName = "FooProvider";
-		
-		// Get the factory to create a component instance
-		Factory fact = helper.getFactory( factName);
-		assertNotNull("Cannot find the factory FooProvider", fact);
-		
-		Properties props = new Properties();
-		props.put("instance.name",compName);
-		props.put("foo", "foo");
-		props.put("bar", "2");
-		props.put("baz", "baz");
-		helper.createComponentInstance(factName, props);
-
-		ServiceReference arch_ref = helper.getServiceReferenceByName(Architecture.class.getName(), compName);
-		assertNotNull("Architecture not available", arch_ref);
-
-		Architecture arch = (Architecture) getServiceObject(arch_ref);
-		InstanceDescription id = arch.getInstanceDescription();
-		
-		assertEquals("Check component instance name (" + id.getName() + ")", id.getName(), compName);
-		assertEquals("Check component type implementation class", id.getComponentDescription().getClassName(), "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-		
-		HandlerDescription[] handlers = id.getHandlers();
-		assertEquals("Number of handlers", handlers.length, 3);
-		
-		//Look for the ProvidedService Handler
-		ProvidedServiceHandlerDescription pshd = null;
-		pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
-
-		
-		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
-		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
-		
-		assertEquals("Check ProvidedService number", ps.length, 1);
-		assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecifications().length, 1);
-		assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[0], FooService.class.getName());
-		assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);
-	
-		Properties prop = ps[0].getProperties();
-		assertNotNull("Check Props", prop);
-		assertEquals("Check service properties number (#" + prop + "?=5)" , prop.size(), 5);
-		assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);
-		assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);
-		assertEquals("Check foo property", prop.get("foo"), "foo");
-		assertEquals("Check bar property", prop.get("bar"), new Integer(2));
-		assertEquals("Check baz property", prop.get("baz"), "baz");
-		
-	}
-	
-	public void testDoubleProviding() {
-		String factName = "PS-FooBarProviderType-1";
-		String compName = "FooProvider";
-		
-		// Get the factory to create a component instance
-		Factory fact = helper.getFactory( factName);
-		assertNotNull("Cannot find the factory FooProvider", fact);
-		
-		helper.createComponentInstance(factName, compName);
-
-		ServiceReference arch_ref = helper.getServiceReferenceByName(Architecture.class.getName(), compName);
-		assertNotNull("Architecture not available", arch_ref);
-
-		Architecture arch = (Architecture) getServiceObject(arch_ref);
-		InstanceDescription id = arch.getInstanceDescription();
-		
-		assertEquals("Check component instance name (" + id.getName() + ")", id.getName(), compName);
-		assertEquals("Check component type implementation class", id.getComponentDescription().getClassName(), "org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1");
-		
-		HandlerDescription[] handlers = id.getHandlers();
-		assertEquals("Number of handlers", handlers.length, 2);
-		
-		//Look for the ProvidedService Handler
-		ProvidedServiceHandlerDescription pshd = null;
-        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
-
-//		for(int i = 0; i < handlers.length; i++) {
-//			if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-//				pshd = (ProvidedServiceHandlerDescription) handlers[i];
-//			}
-//		}
-		
-		assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
-		ProvidedServiceDescription[] ps = pshd.getProvidedServices();
-		
-		assertEquals("Check ProvidedService number", ps.length, 1);
-		assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecifications().length, 2);
-		assertContains("Check provided service specs - 2", ps[0].getServiceSpecifications(), FooService.class.getName());;
-		assertContains("Check provided service specs - 2", ps[0].getServiceSpecifications(), BarService.class.getName());
-		assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);
-		
-	}
-
-    public void testPropsNoValue() {
-    	String factName = "PS-FooProviderType-3";
-    	String compName = "FooProvider";
-    	
-    	// Get the factory to create a component instance
-    	Factory fact = helper.getFactory( factName);
-    	assertNotNull("Cannot find the factory FooProvider", fact);
-    		
-        helper.createComponentInstance(factName, compName);
-    
-    	ServiceReference arch_ref = helper.getServiceReferenceByName(Architecture.class.getName(), compName);
-    	assertNotNull("Architecture not available", arch_ref);
-    
-    	Architecture arch = (Architecture) getServiceObject(arch_ref);
-    	InstanceDescription id = arch.getInstanceDescription();
-    	
-    	assertEquals("Check component instance name (" + id.getName() + ")", id.getName(), compName);
-    	assertEquals("Check component type implementation class", id.getComponentDescription().getClassName(), "org.apache.felix.ipojo.test.scenarios.component.FooProviderType1");
-    	
-    	HandlerDescription[] handlers = id.getHandlers();
-    	assertEquals("Number of handlers", handlers.length, 3);
-    	
-    	//Look for the ProvidedService Handler
-    	ProvidedServiceHandlerDescription pshd = null;
-        pshd = (ProvidedServiceHandlerDescription) id.getHandlerDescription("org.apache.felix.ipojo:provides");
-
-//    	for(int i = 0; i < handlers.length; i++) {
-//    		if(handlers[i].getHandlerName().equals("org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandler")) {
-//    			pshd = (ProvidedServiceHandlerDescription) handlers[i];
-//    		}
-//    	}
-    	
-    	assertNotNull("Check ProvidedServiceHandlerDescription", pshd);
-    	ProvidedServiceDescription[] ps = pshd.getProvidedServices();
-    	
-    	assertEquals("Check ProvidedService number", ps.length, 1);
-    	assertEquals("Check Provided Service Specs - 1", ps[0].getServiceSpecifications().length, 1);
-    	assertEquals("Check Provided Service Specs - 2", ps[0].getServiceSpecifications()[0], FooService.class.getName());
-    	assertEquals("Check Provided Service availability", ps[0].getState(), ProvidedServiceDescription.REGISTERED);
-    
-    	Properties prop = ps[0].getProperties();
-    	assertNotNull("Check Props", prop);
-    	assertEquals("Check service properties number (#" + prop + "?=5)" , prop.size(), 2);
-    	assertEquals("Check instance.name property", prop.getProperty("instance.name"), compName);
-    	assertEquals("Check factory.name property", prop.getProperty("factory.name"), factName);
-
-    }
-	
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
deleted file mode 100644
index 5ba666d..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ProvidedServiceTestSuite.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ProvidedServiceTestSuite extends TestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Provided Service Test Suite", bc);
-        ots.addTestSuite(Exposition.class);
-        ots.addTestSuite(SimplePS.class);
-        ots.addTestSuite(StaticProps.class);
-        ots.addTestSuite(DynamicProps.class);
-        ots.addTestSuite(StaticPropsReconfiguration.class);
-        ots.addTestSuite(DynamicPropsReconfiguration.class);
-        ots.addTestSuite(InheritedTest.class);
-        ots.addTestSuite(ProvidedServiceArchitectureTest.class);
-        ots.addTestSuite(ClassTest.class);
-        ots.addTestSuite(OSGiPropertiesTest.class);
-        ots.addTestSuite(NullCheck.class);
-        ots.addTestSuite(ServiceControllerTest.class);
-        ots.addTestSuite(PropertiesInAnonymousClassTest.class);
-        ots.addTestSuite(CallbacksTest.class);
-        return ots;
-    }
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java
deleted file mode 100644
index 4261d3e..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/ServiceControllerTest.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceDescription;
-import org.apache.felix.ipojo.handlers.providedservice.ProvidedServiceHandlerDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-
-public class ServiceControllerTest extends OSGiTestCase {
-    
-    IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-    
-    
-    public void testComponentWithAController() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-default");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-        
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        assertFalse(check.check());
-        
-        // FooService should not be there anymore
-        assertNull(getServiceReference(FooService.class.getName()));
-        
-        assertTrue(check.check());
-        
-        assertNotNull(getServiceReference(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithAControllerSetToFalse() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-false");
-        // Controller set to false.
-        waitForService(CheckService.class.getName(), null, 5000);
-        assertNull(getServiceReference(FooService.class.getName()));
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        assertTrue(check.check());
-        assertNotNull(getServiceReference(FooService.class.getName()));
-
-        assertFalse(check.check());
-        // FooService should not be there anymore
-        assertNull(getServiceReference(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersSetToTrue() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-truetrue");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        waitForService(FooService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.check();
-       
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNotNull(getServiceReference(FooService.class.getName()));
-
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.foo();
-        
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNull(getServiceReference(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersSetToTrueAndFalse() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-truefalse");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        
-        assertFalse(isServiceAvailable(FooService.class.getName()));
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.getProps();
-        
-        assertFalse(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-       
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.fooProps();
-        
-        assertTrue(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersUsingBothSpecificationsTrueFalse() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-spec1");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        
-        assertFalse(isServiceAvailable(FooService.class.getName()));
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.getProps();
-        
-        assertFalse(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-       
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.fooProps();
-        
-        assertTrue(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersUsingBothSpecificationsTrueTrue() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-spec2");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        waitForService(FooService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.check();
-        // CheckService not available
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNotNull(getServiceReference(FooService.class.getName()));
-
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.foo();
-        
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNull(getServiceReference(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersUsingSpecificationAndAllTrueTrue() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-spec3");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        waitForService(FooService.class.getName(), null, 5000);
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.check();
-        // CheckService not available
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNotNull(getServiceReference(FooService.class.getName()));
-
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.foo();
-        
-        assertNull(getServiceReference(CheckService.class.getName()));
-        assertNull(getServiceReference(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testComponentWithTwoControllersUsingSpecificationAndAllTrueFalse() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-2-spec4");
-
-        waitForService(CheckService.class.getName(), null, 5000);
-        
-        assertFalse(isServiceAvailable(FooService.class.getName()));
-
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        check.getProps();
-        
-        assertFalse(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-       
-        FooService fs = (FooService) getServiceObject(FooService.class.getName(), null);
-        fs.fooProps();
-        
-        assertTrue(isServiceAvailable(CheckService.class.getName()));
-        assertTrue(isServiceAvailable(FooService.class.getName()));
-        
-        ci.dispose();
-    }
-    
-    public void testArchitecture() {
-        ComponentInstance ci = helper.createComponentInstance("PS-Controller-1-default");
-        // Controller set to true.
-        waitForService(FooService.class.getName(), null, 5000);
-        waitForService(CheckService.class.getName(), null, 5000);
-        
-        ProvidedServiceHandlerDescription pshd = null;
-        pshd = (ProvidedServiceHandlerDescription) ci.getInstanceDescription()
-            .getHandlerDescription("org.apache.felix.ipojo:provides");
-        
-        ProvidedServiceDescription ps = getPS(FooService.class.getName(), pshd.getProvidedServices());
-        assertEquals("true", ps.getController());
-        
-        CheckService check = (CheckService) getServiceObject(CheckService.class.getName(), null);
-        assertNotNull(check);
-        
-        assertFalse(check.check());
-        
-        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());
-        assertEquals("false", ps.getController());
-        
-        assertTrue(check.check());
-        
-        ps = getPS(FooService.class.getName(), pshd.getProvidedServices());
-        assertEquals("true", ps.getController());
-        
-    }
-    
-    private  ProvidedServiceDescription getPS(String itf, ProvidedServiceDescription[] svc) {
-        for (int i = 0; i < svc.length; i++) {
-            if (svc[i].getServiceSpecifications()[0].equals(itf)) {
-                return svc[i];
-            }
-        }
-        
-        fail("Service : " + itf + " not found");
-        return null;
-    }
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java
deleted file mode 100644
index 044fc38..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/SimplePS.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.SimpleClass;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class SimplePS extends OSGiTestCase {
-
-	public void testPS() {
-	    IPOJOHelper helper = new IPOJOHelper(this);
-
-		String factName = "PS-FooProviderType-1";
-		String compName = "FooProvider-1";
-		ServiceReference ref = null;
-
-		// Check that no Foo Service are available
-		ref = getServiceReference(FooService.class.getName());
-
-		assertNull("FS already available", ref);
-
-		// Get the factory to create a component instance
-		Factory fact = helper.getFactory(factName);
-		assertNotNull("Cannot find the factory FooProvider-1", fact);
-
-		helper.createComponentInstance(factName, compName);
-
-		// Get a FooService provider
-		ref = getServiceReference(FooService.class.getName(), "(" + "instance.name" + "=" + compName + ")");
-
-		assertNotNull("FS not available", ref);
-
-		// Test foo invocation
-		FooService fs = (FooService) getServiceObject(ref);
-		assertTrue("FooService invocation failed", fs.foo());
-
-		helper.dispose();
-
-
-		// Check that there is no more FooService
-		ref = getServiceReference(FooService.class.getName(), null);
-
-
-		assertNull("FS available, but component instance stopped", ref);
-
-	}
-
-	public void testWhenNoInterface() {
-		IPOJOHelper helper = new IPOJOHelper(this);
-		String factoryName = "org.apache.felix.ipojo.test.scenarios.component.SimpleClass";
-		ComponentInstance ci = helper.createComponentInstance(factoryName);
-		waitForService(SimpleClass.class.getName(), null, 5000);
-		SimpleClass simple = (SimpleClass) getServiceObject(SimpleClass.class.getName(), null);
-		assertEquals("Hello", simple.hello());
-		ci.dispose();
-	}
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java
deleted file mode 100644
index f40bbe6..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticProps.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class StaticProps extends OSGiTestCase {
-
-	IPOJOHelper helper;
-	
-	public void setUp() {
-	    helper = new IPOJOHelper(this);
-		String type = "PS-FooProviderType-2";
-
-		helper.createComponentInstance(type, "FooProvider-1");
-		
-		Properties p2 = new Properties();
-		p2.put("instance.name","FooProvider-2");
-		p2.put("int", new Integer(4));
-		p2.put("long", new Long(42));
-		p2.put("string", new String("bar"));
-		p2.put("strAProp", new String[] {"bar", "foo"});
-		p2.put("intAProp", new int[] {1, 2, 3});
-		helper.createComponentInstance(type, p2);
-		
-	}
-	
-	public void tearDown() {
-	    helper.dispose();
-	}
-	
-	public void testProperties1() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", longProp, new Long(40));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		       
-	}
-	
-	public void testProperties2() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-2");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(4));
-		assertEquals("Check longProp equality", longProp, new Long(42));
-		assertEquals("Check strProp equality", strProp, new String("bar"));
-
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"bar", "foo"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-	}
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java
deleted file mode 100644
index 8d944d4..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/StaticPropsReconfiguration.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.ps.service.FooService;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ConfigurationException;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class StaticPropsReconfiguration extends OSGiTestCase {
-
-	IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        
-		String type = "PS-FooProviderType-2";
-		helper.createComponentInstance(type, "FooProvider-1");
-		
-		Properties p2 = new Properties();
-		p2.put("instance.name","FooProvider-2");
-		p2.put("int", new Integer(4));
-		p2.put("long", new Long(42));
-		p2.put("string", new String("bar"));
-		p2.put("strAProp", new String[] {"bar", "foo"});
-		p2.put("intAProp", new int[] {1, 2, 3});
-		helper.createComponentInstance(type, p2);
-	}
-	
-	public void tearDown() {
-	    helper.dispose();
-	}
-	
-	public void testReconfFactory1() {
-		ServiceReference sr = helper.getServiceReferenceByName(FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", longProp, new Long(40));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName(Factory.class.getName(), "PS-FooProviderType-2");
-		Dictionary reconf = new Properties();
-		reconf.put("instance.name","FooProvider-1");
-		reconf.put("int", new Integer(5));
-		reconf.put("long", new Long(43));
-		reconf.put("string", new String("toto"));
-		reconf.put("strAProp", new String[] {"foo", "baz"});
-		reconf.put("intAProp", new int[] {3, 2, 1});
-		Factory fact = (Factory) getServiceObject(fact_ref);
-		try {
-			fact.reconfigure(reconf);
-		} catch(Exception e) {
-			fail("Configuration non acceptable : " + reconf);
-		}
-
-		sr = helper.getServiceReferenceByName( FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties after the reconfiguration
-		intProp = (Integer) sr.getProperty("int");
-		longProp = (Long) sr.getProperty("long");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
-		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
-		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
-		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
-		v = new String[] {"foo", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		fact = null;
-		       
-	}
-	
-	public void testReconfFactory2() {
-		ServiceReference sr = helper.getServiceReferenceByName( FooService.class.getName(), "FooProvider-2");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(4));
-		assertEquals("Check longProp equality", longProp, new Long(42));
-		assertEquals("Check strProp equality", strProp, new String("bar"));
-
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"bar", "foo"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName( Factory.class.getName(), "PS-FooProviderType-2");
-		Dictionary reconf = new Properties();
-		reconf.put("instance.name","FooProvider-2");
-		reconf.put("int", new Integer(5));
-		reconf.put("long", new Long(43));
-		reconf.put("string", new String("toto"));
-		reconf.put("strAProp", new String[] {"foo", "baz"});
-		reconf.put("intAProp", new int[] {3, 2, 1});
-		Factory fact = (Factory) getServiceObject(fact_ref);
-		try {
-			fact.reconfigure(reconf);
-		} catch(Exception e) {
-			fail("Configuration non acceptable : " + reconf);
-		}
-		
-		// Check service properties after the reconfiguration
-		intProp = (Integer) sr.getProperty("int");
-		longProp = (Long) sr.getProperty("long");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
-		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
-		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
-		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
-		v = new String[] {"foo", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		fact = null;
-	}
-	
-	public void testMSFFactory1() {
-		ServiceReference sr = helper.getServiceReferenceByName( FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(2));
-		assertEquals("Check longProp equality", longProp, new Long(40));
-		assertEquals("Check strProp equality", strProp, new String("foo"));
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"foo", "bar"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName( ManagedServiceFactory.class.getName(), "PS-FooProviderType-2");
-		Dictionary reconf = new Properties();
-		reconf.put("int", new Integer(5));
-		reconf.put("long", new Long(43));
-		reconf.put("string", new String("toto"));
-		reconf.put("strAProp", new String[] {"foo", "baz"});
-		reconf.put("intAProp", new int[] {3, 2, 1});
-		ManagedServiceFactory fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-		try {
-			fact.updated("FooProvider-1", reconf);
-		} catch (ConfigurationException e) {
-			fail("Configuration non acceptable : " + reconf);
-		}
-
-		sr = helper.getServiceReferenceByName( FooService.class.getName(), "FooProvider-1");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties after the reconfiguration
-		intProp = (Integer) sr.getProperty("int");
-		longProp = (Long) sr.getProperty("long");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
-		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
-		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
-		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
-		v = new String[] {"foo", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		fact = null;
-		       
-	}
-	
-	public void testReconfMSF2() {
-		ServiceReference sr = helper.getServiceReferenceByName( FooService.class.getName(), "FooProvider-2");
-		assertNotNull("Check the availability of the FS service", sr);
-		
-		// Check service properties
-		Integer intProp = (Integer) sr.getProperty("int");
-		Long longProp = (Long) sr.getProperty("long");
-		String strProp = (String) sr.getProperty("string");
-		String[] strAProp = (String[]) sr.getProperty("strAProp");
-		int[] intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality", intProp, new Integer(4));
-		assertEquals("Check longProp equality", longProp, new Long(42));
-		assertEquals("Check strProp equality", strProp, new String("bar"));
-
-		assertNotNull("Check strAProp not nullity", strAProp);
-		String[] v = new String[] {"bar", "foo"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		int[] v2 = new int[] {1, 2, 3};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		// Reconfiguration
-		ServiceReference fact_ref = helper.getServiceReferenceByName( ManagedServiceFactory.class.getName(), "PS-FooProviderType-2");
-		Dictionary reconf = new Properties();
-		reconf.put("int", new Integer(5));
-		reconf.put("long", new Long(43));
-		reconf.put("string", new String("toto"));
-		reconf.put("strAProp", new String[] {"foo", "baz"});
-		reconf.put("intAProp", new int[] {3, 2, 1});
-		ManagedServiceFactory fact = (ManagedServiceFactory) getServiceObject(fact_ref);
-		try {
-			fact.updated("FooProvider-2", reconf);
-		} catch (ConfigurationException e) {
-			fail("Configuration non acceptable : " + reconf);
-		}
-		
-		// Check service properties after the reconfiguration
-		intProp = (Integer) sr.getProperty("int");
-		longProp = (Long) sr.getProperty("long");
-		strProp = (String) sr.getProperty("string");
-		strAProp = (String[]) sr.getProperty("strAProp");
-		intAProp = (int[]) sr.getProperty("intAProp");
-		
-		assertEquals("Check intProp equality after reconfiguration", intProp, new Integer(5));
-		assertEquals("Check longProp equality after reconfiguration", longProp, new Long(43));
-		assertEquals("Check strProp equality after reconfiguration", strProp, new String("toto"));
-		assertNotNull("Check strAProp not nullity after reconfiguration", strAProp);
-		v = new String[] {"foo", "baz"};
-		for (int i = 0; i < strAProp.length; i++) {
-			if(!strAProp[i].equals(v[i])) { fail("Check the strAProp Equality"); }
-		}
-		assertNotNull("Check intAProp not nullity", intAProp);
-		v2 = new int[] {3, 2, 1};
-		for (int i = 0; i < intAProp.length; i++) {
-			if(intAProp[i] != v2[i]) { fail("Check the intAProp Equality"); }
-		}
-		
-		fact = null;
-	}
-	
-	
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java
deleted file mode 100644
index 7ccee67..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java
deleted file mode 100644
index f500f79..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java
deleted file mode 100644
index b3d8974..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ChildInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-public interface ChildInterface extends ParentInterface1, ParentInterface2 {
-    
-    public void processChild();
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java
deleted file mode 100644
index 7bf3e25..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java
deleted file mode 100644
index f032f3e..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface1.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-public interface ParentInterface1 extends ParentParentInterface {
-    
-    public void processParent1();
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java
deleted file mode 100644
index 8369a14..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentInterface2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-public interface ParentInterface2 {
-    
-    public void processParent2();
-
-}
diff --git a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java b/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java
deleted file mode 100644
index d9fa406..0000000
--- a/ipojo/tests/core/service-providing/src/main/java/org/apache/felix/ipojo/test/scenarios/ps/service/ParentParentInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.ps.service;
-
-public interface ParentParentInterface {
-    
-    public void processParentParent();
-
-}
diff --git a/ipojo/tests/handler/eventadmin/pom.xml b/ipojo/tests/handler/eventadmin/pom.xml
deleted file mode 100644
index 908f17d..0000000
--- a/ipojo/tests/handler/eventadmin/pom.xml
+++ /dev/null
@@ -1,122 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>ipojo.tests</groupId>
-        <artifactId>ipojo.tests</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <groupId>ipojo.tests</groupId>
-    <version>${ipojo.eah.snapshot}</version>
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>bundle</packaging>
-    <name>iPOJO Event Admin Handler Test Suite</name>
-    <artifactId>tests.eventadmin.handler</artifactId>
-
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
-      <version>${ipojo.eah.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.eventadmin</artifactId>
-      <version>1.2.2</version>
-      <scope>test</scope>
-    </dependency>
-  </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Private-Package>org.apache.felix.ipojo.test.*
-                            </Private-Package>
-                        <Import-Package>org.apache.felix.ipojo.handlers.event, *</Import-Package>    
-                        <Test-Suite>
-                            org.apache.felix.ipojo.test.EahTestSuite
-                        </Test-Suite>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-ipojo-plugin</artifactId>
-                <version>${ipojo.manipulator.snapshot}</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>ipojo-bundle</goal>
-                        </goals>
-                        <configuration>
-                            <ignoreAnnotations>true</ignoreAnnotations>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-junit4osgi-plugin
-            </artifactId>
-            <version>1.1.0-SNAPSHOT</version>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>test</goal>
-                </goals>
-                <configuration>
-                  
-                </configuration>
-              </execution>
-            </executions>
-         </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
deleted file mode 100644
index bdab8ab..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/BadTests.java
+++ /dev/null
@@ -1,964 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-import org.apache.felix.ipojo.ComponentFactory;
-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.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Attribute;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.test.donut.Donut;
-import org.apache.felix.ipojo.test.donut.DonutConsumer;
-import org.apache.felix.ipojo.test.donut.DonutProvider;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.apache.felix.ipojo.test.util.IPojoTestUtils;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Test the good behaviour of the EventAdminHandler.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class BadTests extends OSGiTestCase {
-	
-	 /**
-     * The utility class instance.
-     */
-    public EahTestUtils m_utils;
-
-    /**
-     * The namespace of the Event admin handler.
-     */
-    private static final String NAMESPACE = "org.apache.felix.ipojo.handlers.event";
-    
-    /**
-     * The available components.
-     */
-    private Element[] m_components;
-
-    /**
-     * The description of a component that uses an event publisher.
-     */
-    private Element m_provider;
-
-    /**
-     * The event publisher description.
-     */
-    private Element m_publisher;
-
-    /**
-     * The name attribute of the event publisher.
-     */
-    private Attribute m_publisherName;
-
-    /**
-     * The field attribute of the event publisher.
-     */
-    private Attribute m_publisherField;
-
-    /**
-     * The topics attribute of the event publisher.
-     */
-    private Attribute m_publisherTopics;
-
-    /**
-     * The data-key attribute of the event publisher.
-     */
-    private Attribute m_publisherDataKey;
-
-    /**
-     * The synchronous attribute of the event publisher.
-     */
-    private Attribute m_publisherSynchronous;
-
-    /**
-     * The description of a component that uses an event subscriber.
-     */
-    private Element m_consumer;
-
-    /**
-     * The event subscriber description.
-     */
-    private Element m_subscriber;
-
-    /**
-     * The name attribute of the event subscriber.
-     */
-    private Attribute m_subscriberName;
-
-    /**
-     * The callback attribute of the event subscriber.
-     */
-    private Attribute m_subscriberCallback;
-
-    /**
-     * The topics attribute of the event subscriber.
-     */
-    private Attribute m_subscriberTopics;
-
-    /**
-     * The data-key attribute of the event subscriber.
-     */
-    private Attribute m_subscriberDataKey;
-
-    /**
-     * The data-type attribute of the event subscriber.
-     */
-    private Attribute m_subscriberDataType;
-
-    private Element getManipulationForComponent(String compName) {
-        for (int i = 0; i < m_components.length; i++) {
-            if (m_components[i].containsAttribute("name")
-                    && m_components[i].getAttribute("name").equals(compName)) {
-                return m_components[i].getElements("manipulation")[0];
-            }
-        }
-        return null;
-    }
-
-    /**
-     * Initialization before test cases.
-     * 
-     * Create all the instances
-     * 
-     */
-    public void setUp() {
-    	m_utils = new EahTestUtils(getContext());
-        /**
-         * Get the list of available components.
-         */
-        try {
-            String header = (String) getContext().getBundle().getHeaders().get(
-                    "iPOJO-Components");
-            m_components = ManifestMetadataParser.parseHeaderMetadata(header)
-                    .getElements("component");
-        } catch (ParseException e) {
-            fail("Parse Exception when parsing iPOJO-Component");
-        }
-
-        /**
-         * Initialize the standard publishing component (based on the
-         * asynchronous donut provider).
-         */
-        m_provider = new Element("component", "");
-        m_provider.addAttribute(new Attribute("className",
-                "org.apache.felix.ipojo.test.donut.DonutProviderImpl"));
-        m_provider.addAttribute(new Attribute("name",
-                "standard donut provider for bad tests"));
-
-        // The provided service of the publisher
-        Element providesDonutProvider = new Element("provides", "");
-        providesDonutProvider.addAttribute(new Attribute("interface",
-                "org.apache.felix.ipojo.test.donut.DonutProvider"));
-        Element providesDonutProviderProperty = new Element("property", "");
-        providesDonutProviderProperty
-                .addAttribute(new Attribute("name", "name"));
-        providesDonutProviderProperty.addAttribute(new Attribute("field",
-                "m_name"));
-        providesDonutProviderProperty.addAttribute(new Attribute("value",
-                "Unknown donut vendor"));
-        providesDonutProvider.addElement(providesDonutProviderProperty);
-        m_provider.addElement(providesDonutProvider);
-
-        // The event publisher, corresponding to the following description :
-        // <ev:publisher name="donut-publisher" field="m_publisher"
-        // topics="food/donuts" data-key="food" synchronous="false"/>
-        m_publisher = new Element("publisher", NAMESPACE);
-        m_publisherName = new Attribute("name", "donut-publisher");
-        m_publisherField = new Attribute("field", "m_publisher");
-        m_publisherTopics = new Attribute("topics", "food/donuts");
-        m_publisherDataKey = new Attribute("data-key", "food");
-        m_publisherSynchronous = new Attribute("synchronous", "false");
-        m_publisher.addAttribute(m_publisherName);
-        m_publisher.addAttribute(m_publisherField);
-        m_publisher.addAttribute(m_publisherTopics);
-        m_publisher.addAttribute(m_publisherDataKey);
-        m_publisher.addAttribute(m_publisherSynchronous);
-        m_provider.addElement(m_publisher);
-
-        m_provider.addElement(getManipulationForComponent("donut-provider"));
-
-        /**
-         * Initialize the standard subscribing component (based on the donut
-         * consumer).
-         */
-        m_consumer = new Element("component", "");
-        m_consumer.addAttribute(new Attribute("className",
-                "org.apache.felix.ipojo.test.donut.DonutConsumerImpl"));
-        m_consumer.addAttribute(new Attribute("name",
-                "standard donut consumer for bad tests"));
-
-        // The provided service of the publisher
-        Element providesDonutConsumer = new Element("provides", "");
-        providesDonutConsumer.addAttribute(new Attribute("interface",
-                "org.apache.felix.ipojo.test.donut.DonutConsumer"));
-        Element providesDonutConsumerNameProperty = new Element("property", "");
-        providesDonutConsumerNameProperty.addAttribute(new Attribute("name",
-                "name"));
-        providesDonutConsumerNameProperty.addAttribute(new Attribute("field",
-                "m_name"));
-        providesDonutConsumerNameProperty.addAttribute(new Attribute("value",
-                "Unknown donut consumer"));
-        providesDonutConsumer.addElement(providesDonutConsumerNameProperty);
-        Element providesDonutConsumerSlowProperty = new Element("property", "");
-        providesDonutConsumerSlowProperty.addAttribute(new Attribute("name",
-                "slow"));
-        providesDonutConsumerSlowProperty.addAttribute(new Attribute("field",
-                "m_isSlow"));
-        providesDonutConsumerSlowProperty.addAttribute(new Attribute("value",
-                "false"));
-        providesDonutConsumer.addElement(providesDonutConsumerSlowProperty);
-        m_consumer.addElement(providesDonutConsumer);
-
-        // The event publisher, corresponding to the following description :
-        // <ev:subscriber name="donut-subscriber" callback="receiveDonut"
-        // topics="food/donuts" data-key="food"
-        // data-type="org.apache.felix.ipojo.test.donut.Donut"/>
-        m_subscriber = new Element("subscriber", NAMESPACE);
-        m_subscriberName = new Attribute("name", "donut-subscriber");
-        m_subscriberCallback = new Attribute("callback", "receiveDonut");
-        m_subscriberTopics = new Attribute("topics", "food/donuts");
-        m_subscriberDataKey = new Attribute("data-key", "food");
-        m_subscriberDataType = new Attribute("data-type",
-                "org.apache.felix.ipojo.test.donut.Donut");
-        m_subscriber.addAttribute(m_subscriberName);
-        m_subscriber.addAttribute(m_subscriberCallback);
-        m_subscriber.addAttribute(m_subscriberTopics);
-        m_subscriber.addAttribute(m_subscriberDataKey);
-        m_subscriber.addAttribute(m_subscriberDataType);
-        m_consumer.addElement(m_subscriber);
-
-        m_consumer.addElement(getManipulationForComponent("donut-consumer"));
-    }
-
-    /**
-     * Test the base configuration is correct to be sure the bad tests will fail
-     * because of they are really bad, and not because of an other application
-     * error.
-     * 
-     * This test simply create a provider and a consumer instance, send one
-     * event and check it is received.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testGoodConfig()
-        throws ConfigurationException, UnacceptableConfiguration,
-        MissingHandlerException {
-        /**
-         * Create the provider and the consumer instances.
-         */
-        Dictionary properties = new Hashtable();
-
-        // Provider
-        ComponentFactory providerFactory = new ComponentFactory(getContext(),
-                m_provider);
-        providerFactory.start();
-        properties.put("instance.name","Emperor of donuts");
-        ComponentInstance providerInstance = providerFactory
-                .createComponentInstance(properties);
-        ServiceReference providerService = IPojoTestUtils
-                .getServiceReferenceByName(getContext(), DonutProvider.class
-                        .getName(), providerInstance.getInstanceName());
-        DonutProvider provider = (DonutProvider) getContext()
-                .getService(providerService);
-
-        // The consumer
-        properties = new Hashtable();
-        ComponentFactory consumerFactory = new ComponentFactory(getContext(),
-                m_consumer);
-        consumerFactory.start();
-        properties.put("instance.name","Homer Simpson");
-        properties.put("slow", "false");
-        ComponentInstance consumerInstance = consumerFactory
-                .createComponentInstance(properties);
-        ServiceReference consumerService = IPojoTestUtils
-                .getServiceReferenceByName(getContext(), DonutConsumer.class
-                        .getName(), consumerInstance.getInstanceName());
-        DonutConsumer consumer = (DonutConsumer) getContext()
-                .getService(consumerService);
-
-        /**
-         * Test the normal behaviour of the instances.
-         */
-        consumer.clearDonuts();
-        Donut sentDonut = provider.sellDonut();
-        Donut receivedDonut = consumer.waitForDonut();
-        assertEquals("The received donut must be the same as the sent one.",
-                sentDonut, receivedDonut);
-
-        /**
-         * Destroy component's instances.
-         */
-        getContext().ungetService(providerService);
-        providerInstance.dispose();
-        getContext().ungetService(consumerService);
-        consumerInstance.dispose();
-        providerFactory.stop();
-        consumerFactory.stop();
-    }
-
-    /**
-     * Try to create a publisher with no name.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithoutName()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher
-        m_publisher.removeAttribute(m_publisherName);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when no name is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.addAttribute(m_publisherName);
-        }
-    }
-
-    /**
-     * Try to create a publisher with no field.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithoutField()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher
-        m_publisher.removeAttribute(m_publisherField);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when no field is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.addAttribute(m_publisherField);
-        }
-    }
-
-    /**
-     * Try to create a publisher with an unexisting field.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithUnexistingField()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher and replace with an
-        // unexisting field name
-        m_publisher.removeAttribute(m_publisherField);
-        Attribute unexistingField = new Attribute("field", "m_unexistingField");
-        m_publisher.addAttribute(unexistingField);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when an unexisting field is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.removeAttribute(unexistingField);
-            m_publisher.addAttribute(m_publisherField);
-        }
-    }
-
-    /**
-     * Try to create a publisher with a bad typed field.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithBadTypedField()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher and replace with an
-        // bad typed field name
-        m_publisher.removeAttribute(m_publisherField);
-        Attribute badTypedField = new Attribute("field", "m_name");
-        m_publisher.addAttribute(badTypedField);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when an bad typed field is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.removeAttribute(badTypedField);
-            m_publisher.addAttribute(m_publisherField);
-        }
-    }
-
-    /**
-     * Try to create a publisher instance without topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithoutTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the publisher
-        m_publisher.removeAttribute(m_publisherTopics);
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        fact.start();
-
-        // Try to create an instance without specified topics
-        Dictionary conf = new Hashtable();
-        conf.put("instance.name","provider without topics");
-
-        ComponentInstance instance;
-        try {
-            instance = fact.createComponentInstance(conf);
-            // Should not be executed
-            instance.dispose();
-            fail("The factory must not create instance without specified topics.");
-        } catch (ConfigurationException e) {
-            // OK
-        } finally {
-            fact.stop();
-            // Restore the original state of the publisher
-            m_publisher.addAttribute(m_publisherTopics);
-        }
-    }
-
-    /**
-     * Try to create a publisher with malformed topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithMalformedTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the publisher and replace with a
-        // malformed one
-        m_publisher.removeAttribute(m_publisherTopics);
-        Attribute malformedTopics = new Attribute("topics",
-                "| |\\| \\/ /-\\ |_ | |)");
-        m_publisher.addAttribute(malformedTopics);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when invalid topics are specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.removeAttribute(malformedTopics);
-            m_publisher.addAttribute(m_publisherTopics);
-        }
-    }
-    
-    /**
-     * Try to create a publisher with a pattern topic (ending with '*') instead of a fixed topic.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithPatternTopic()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the publisher and replace with a
-        // malformed one
-        m_publisher.removeAttribute(m_publisherTopics);
-        Attribute malformedTopics = new Attribute("topics",
-                "a/pattern/topic/*");
-        m_publisher.addAttribute(malformedTopics);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when invalid topics are specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_publisher.removeAttribute(malformedTopics);
-            m_publisher.addAttribute(m_publisherTopics);
-        }
-    }
-
-    /**
-     * Try to create a publisher with malformed instance topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testPublisherWithMalformedInstanceTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the publisher and replace with a
-        // malformed one
-        m_publisher.removeAttribute(m_publisherTopics);
-        ComponentFactory fact = new ComponentFactory(getContext(), m_provider);
-        fact.start();
-
-        // Try to create an instance with malformed specified topics
-        Dictionary conf = new Hashtable();
-        conf.put("instance.name","provider with malformed topics");
-        Dictionary topics = new Hashtable();
-        topics.put("donut-publisher", "| |\\| \\/ /-\\ |_ | |)");
-        conf.put("event.topics", topics);
-
-        ComponentInstance instance;
-        try {
-            instance = fact.createComponentInstance(conf);
-            // Should not be executed
-            instance.dispose();
-            fail("The factory must not create instance with invalid specified topics.");
-        } catch (ConfigurationException e) {
-            // OK
-        } finally {
-            fact.stop();
-            // Restore the original state of the publisher
-            m_publisher.addAttribute(m_publisherTopics);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with no name.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithoutName()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher
-        m_subscriber.removeAttribute(m_subscriberName);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when no name is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_subscriber.addAttribute(m_subscriberName);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with no callback.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithoutCallback()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the name attribute of the publisher
-        m_subscriber.removeAttribute(m_subscriberCallback);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when no callback is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the publisher
-            m_subscriber.addAttribute(m_subscriberCallback);
-        }
-    }
-
-    /**
-     * Try to create a subscriber instance without topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithoutTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the subscriber
-        m_subscriber.removeAttribute(m_subscriberTopics);
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        fact.start();
-
-        // Try to create an instance without specified topics
-        Dictionary conf = new Hashtable();
-        conf.put("instance.name","consumer without topics");
-        conf.put("slow", "false");
-
-        ComponentInstance instance;
-        try {
-            instance = fact.createComponentInstance(conf);
-            // Should not be executed
-            instance.dispose();
-            fail("The factory must not create instance without specified topics.");
-        } catch (ConfigurationException e) {
-            // OK
-        } finally {
-            fact.stop();
-            // Restore the original state of the subscriber
-            m_subscriber.addAttribute(m_subscriberTopics);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with malformed topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithMalformedTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the subscriber and replace with a
-        // malformed one
-        m_subscriber.removeAttribute(m_subscriberTopics);
-        Attribute malformedTopics = new Attribute("topics",
-                "| |\\| \\/ /-\\ |_ | |)");
-        m_subscriber.addAttribute(malformedTopics);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when invalid topics are specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the subscriber
-            m_subscriber.removeAttribute(malformedTopics);
-            m_subscriber.addAttribute(m_subscriberTopics);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with malformed instance topics.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithMalformedInstanceTopics()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the topics attribute of the subscriber and replace with a
-        // malformed one
-        m_subscriber.removeAttribute(m_subscriberTopics);
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        fact.start();
-
-        // Try to create an instance with malformed specified topics
-        Dictionary conf = new Hashtable();
-        conf.put("instance.name","consumer with malformed topics");
-        Dictionary topics = new Hashtable();
-        topics.put("donut-subscriber", "| |\\| \\/ /-\\ |_ | |)");
-        conf.put("event.topics", topics);
-
-        ComponentInstance instance;
-        try {
-            instance = fact.createComponentInstance(conf);
-            // Should not be executed
-            instance.dispose();
-            fail("The factory must not create instance with invalid specified topics.");
-        } catch (ConfigurationException e) {
-            // OK
-        } finally {
-            fact.stop();
-            // Restore the original state of the subscriber
-            m_subscriber.addAttribute(m_subscriberTopics);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with unknown data type.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithUnknownDataType()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the data-type attribute of the subscriber and replace with a
-        // malformed one
-        m_subscriber.removeAttribute(m_subscriberDataType);
-        Attribute unknownType = new Attribute("data-type", "org.unknown.Clazz");
-        m_subscriber.addAttribute(unknownType);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when unknown data type is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the subscriber
-            m_subscriber.removeAttribute(unknownType);
-            m_subscriber.addAttribute(m_subscriberDataType);
-        }
-    }
-
-    /**
-     * Try to create a subscriber with a data type that does not match with the
-     * callback parameter type.
-     * 
-     * @throws ConfigurationException
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     */
-    public void testSubscriberWithUnappropriatedDataType()
-        throws ConfigurationException, MissingHandlerException,
-        UnacceptableConfiguration {
-
-        // Remove the data-type attribute of the subscriber and replace with a
-        // malformed one
-        m_subscriber.removeAttribute(m_subscriberDataType);
-        Attribute unknownType = new Attribute("data-type", "java.lang.String");
-        m_subscriber.addAttribute(unknownType);
-
-        // Create and try to start the factory
-        ComponentFactory fact = new ComponentFactory(getContext(), m_consumer);
-        try {
-            fact.start();
-            // Should not be executed
-            fact.stop();
-            fail("The factory must not start when unappropriated data type is specified.");
-        } catch (IllegalStateException e) {
-            // OK
-        } finally {
-            // Restore the original state of the subscriber
-            m_subscriber.removeAttribute(unknownType);
-            m_subscriber.addAttribute(m_subscriberDataType);
-        }
-    }
-
-    /**
-     * Finalization after test cases.
-     * 
-     * Release all services references and destroy instances.
-     */
-    public void tearDown() {
-
-    }
-
-    // DEBUG
-    public void dumpElement(String message, Element root) {
-        System.err.println(message + "\n" + dumpElement(0, root));
-    }
-
-    // DEBUG
-    private String dumpElement(int level, Element element) {
-        StringBuilder sb = new StringBuilder();
-        // Enter tag
-        for (int i = 0; i < level; i++) {
-            sb.append("  ");
-        }
-        sb.append('<');
-        sb.append(element.getName());
-        Attribute[] attributes = element.getAttributes();
-        for (int i = 0; i < attributes.length; i++) {
-            Attribute attribute = attributes[i];
-            sb.append(' ');
-            sb.append(attribute.getName());
-            sb.append('=');
-            sb.append(attribute.getValue());
-        }
-        sb.append(">\n");
-        // Children
-        Element[] elements = element.getElements();
-        for (int i = 0; i < elements.length; i++) {
-            sb.append(dumpElement(level + 1, elements[i]));
-        }
-        // Exit tag
-        for (int i = 0; i < level; i++) {
-            sb.append("  ");
-        }
-        sb.append("</" + element.getName() + ">\n");
-        return sb.toString();
-    }
-    
-    /**
-     * Creates a subscriber listening on a pattern topic (ending with '*').
-     * @throws ConfigurationException something bad happened.
-     * @throws MissingHandlerException something bad happened.
-     * @throws UnacceptableConfiguration something bad happened.
-     */
-    public void testSubscriberWithPatternTopic() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-    	Dictionary properties = new Hashtable();
-    	Dictionary topics = new Hashtable();
-
-        // Create the donut consumer instance, listening on a pattern topic
-        properties.put("instance.name","subscriber with pattern topic");
-        topics.put("donut-subscriber", "a/pattern/topic/*rf");
-        properties.put("event.topics", topics);
-        ComponentInstance instance = null;
-        try {
-        	instance = m_utils.getDonutConsumerFactory()
-            .createComponentInstance(properties);
-        	
-        	// Should not been executed
-        	instance.dispose();
-        	 fail("An invalid topic scope was accepted)");
-        	 
-        } catch (ConfigurationException e) {
-        	// Nothing to do
-        }
-        
-    	properties = new Hashtable();
-    	topics = new Hashtable();
-
-        // Create the donut consumer instance, listening on a pattern topic
-        properties.put("instance.name","subscriber with pattern topic");
-        topics.put("donut-subscriber", "a/pattern/*topic/rf");
-        properties.put("event.topics", topics);
-        
-        try {
-        	instance = m_utils.getDonutConsumerFactory()
-            .createComponentInstance(properties);
-        	instance.dispose();
-        	fail("An invalid topic scope was accepted (2)");
-        } catch (ConfigurationException e) {
-        	// Nothing to do
-        }
-    }
-
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/EahTestSuite.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/EahTestSuite.java
deleted file mode 100644
index 7eddfca..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/EahTestSuite.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-/**
- * Event Admin Handler test suite.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class EahTestSuite {
-
-    /**
-     * Generate the Event Admin Handler test suite.
-     *
-     * @param bc
-     *            the OSGi bundle context
-     * @return the Event Admin Handler test suite.
-     */
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Event Admin Handler test suite",
-                bc);
-        ots.addTestSuite(BadTests.class);
-        ots.addTestSuite(GoodTests.class);
-        ots.addTestSuite(GoodTestsWithNewAttributes.class);
-        ots.addTestSuite(PublishesTests.class);
-        return ots;
-    }
-
-}
\ No newline at end of file
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java
deleted file mode 100644
index ff949ac..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTests.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
-
-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.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.donut.Donut;
-import org.apache.felix.ipojo.test.donut.DonutConsumer;
-import org.apache.felix.ipojo.test.donut.DonutProvider;
-import org.apache.felix.ipojo.test.donut.EventTracker;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.apache.felix.ipojo.test.util.IPojoTestUtils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.event.Event;
-
-/**
- * Test the good behaviour of the EventAdminHandler.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class GoodTests extends OSGiTestCase {
-
-    /**
-     * The number of providers to test.
-     */
-    private static final int NUMBER_OF_PROVIDERS = 6;
-
-    /**
-     * The number of providers using the event admin handler to test.
-     */
-    private static final int NUMBER_OF_EAH_PROVIDERS = 4;
-
-    /**
-     * The number of consumers to test.
-     */
-    private static final int NUMBER_OF_CONSUMERS = 6;
-
-    /**
-     * The number of synchronous providers to test.
-     */
-    private static final int NUMBER_OF_SYNCHRONOUS_PROVIDERS = 3;
-
-    /**
-     * The number of slow consumers to test.
-     */
-    private static final int NUMBER_OF_QUICK_CONSUMERS = 3;
-
-    /**
-     * The list of topics to test.
-     */
-    private static final String[] TOPICS_LIST = { "foo", "bar", "nut",
-        "foo,bar", "bar,nut", "foo,nut", "foo,bar,nut" };
-
-    /**
-     * The utility class instance.
-     */
-    public EahTestUtils m_utils;
-
-    /**
-     * The providers' instances.
-     */
-    private ComponentInstance[] m_providersInstances;
-
-    /**
-     * The providers' service references.
-     */
-    private ServiceReference[] m_providersServices;
-
-    /**
-     * The providers' services.
-     */
-    private DonutProvider[] m_providers;
-
-    /**
-     * The synchronous providers' services.
-     */
-    private DonutProvider[] m_synchronousProviders;
-
-    /**
-     * The instances of providers that uses the event admin handler.
-     */
-    private ComponentInstance[] m_eahProvidersInstances;
-
-    /**
-     * The services of the providers that uses the event admin handler.
-     */
-    private DonutProvider[] m_eahProviders;
-
-    /**
-     * The synchronous donut event provider service.
-     */
-    private DonutProvider m_synchronousDonutEventProvider;
-
-    /**
-     * The consumers' instances.
-     */
-    private ComponentInstance[] m_consumersInstances;
-
-    /**
-     * The consumers' service references.
-     */
-    private ServiceReference[] m_consumersServices;
-
-    /**
-     * The consumers' services.
-     */
-    private DonutConsumer[] m_consumers;
-
-    /**
-     * The slow consumers' services.
-     */
-    private DonutConsumer[] m_quickConsumers;
-
-    /**
-     * The event tracker' instances.
-     */
-    private ComponentInstance m_eventTrackerInstance;
-
-    /**
-     * The event tracker' service references.
-     */
-    private ServiceReference m_eventTrackerService;
-
-    /**
-     * The event tracker service.
-     */
-    private EventTracker m_eventTracker;
-
-    /**
-     * The filtered consumers' instances.
-     */
-    private ComponentInstance[] m_filteredConsumersInstances;
-
-    /**
-     * The filtered consumers' service references.
-     */
-    private ServiceReference[] m_filteredConsumersServices;
-
-    /**
-     * The filtered consumers' services.
-     */
-    private DonutConsumer[] m_filteredConsumers;
-
-    /**
-     * The providers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsProvidersInstances;
-
-    /**
-     * The providers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsProvidersServices;
-
-    /**
-     * The providers' service with specified topics.
-     */
-    private DonutProvider[] m_topicsProviders;
-
-    /**
-     * The provider that send donuts on the "foo" topic.
-     */
-    private DonutProvider m_fooProvider;
-
-    /**
-     * The provider that send donuts on the "bar" topic.
-     */
-    private DonutProvider m_barProvider;
-
-    /**
-     * The provider that send donuts on the "nut" topic.
-     */
-    private DonutProvider m_nutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar" topics.
-     */
-    private DonutProvider m_fooBarProvider;
-
-    /**
-     * The provider that send donuts on the "bar,nut" topics.
-     */
-    private DonutProvider m_barNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,nut" topics.
-     */
-    private DonutProvider m_fooNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar,nut" topics.
-     */
-    private DonutProvider m_fooBarNutProvider;
-
-    /**
-     * The consumers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsConsumersInstances;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsConsumersServices;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private DonutConsumer[] m_topicsConsumers;
-
-    /**
-     * The consumer that receive donuts on the "foo" topic.
-     */
-    private DonutConsumer m_fooConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar" topic.
-     */
-    private DonutConsumer m_barConsumer;
-
-    /**
-     * The consumer that receive donuts on the "nut" topic.
-     */
-    private DonutConsumer m_nutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar" topics.
-     */
-    private DonutConsumer m_fooBarConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar,nut" topics.
-     */
-    private DonutConsumer m_barNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,nut" topics.
-     */
-    private DonutConsumer m_fooNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar,nut" topics.
-     */
-    private DonutConsumer m_fooBarNutConsumer;
-
-    /**
-     * Initialization before test cases.
-     * 
-     * Create all the instances
-     * 
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws ConfigurationException
-     *             something bad happened
-     * 
-     */
-    public void setUp()
-        throws UnacceptableConfiguration, MissingHandlerException,
-        ConfigurationException {
-
-        m_utils = new EahTestUtils(getContext());
-        Dictionary properties = new Hashtable();
-
-        // All the providers
-        m_providersInstances = new ComponentInstance[NUMBER_OF_PROVIDERS];
-        m_providersServices = new ServiceReference[NUMBER_OF_PROVIDERS];
-        m_providers = new DonutProvider[NUMBER_OF_PROVIDERS];
-        m_synchronousProviders = new DonutProvider[NUMBER_OF_SYNCHRONOUS_PROVIDERS];
-        m_eahProviders = new DonutProvider[NUMBER_OF_EAH_PROVIDERS];
-        m_eahProvidersInstances = new ComponentInstance[NUMBER_OF_EAH_PROVIDERS];
-        m_topicsProvidersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsProvidersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsProviders = new DonutProvider[TOPICS_LIST.length];
-
-        // Create the (asynchronous) donut provider
-        properties.put("instance.name","asynchronous donut provider");
-        m_providersInstances[0] = m_utils.getDonutProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut provider");
-        m_providersInstances[1] = m_utils.getSynchronousDonutProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous donut event provider");
-        m_providersInstances[2] = m_utils.getDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut event provider");
-        m_providersInstances[3] = m_utils
-                .getSynchronousDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous event provider");
-        m_providersInstances[4] = m_utils.getEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous event provider");
-        m_providersInstances[5] = m_utils.getSynchronousEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            m_providersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutProvider.class.getName(),
-                    m_providersInstances[i].getInstanceName());
-            m_providers[i] = (DonutProvider) getContext()
-                    .getService(m_providersServices[i]);
-        }
-        m_synchronousProviders[0] = m_providers[1];
-        m_synchronousProviders[1] = m_providers[3];
-        m_synchronousProviders[2] = m_providers[5];
-        m_eahProviders[0] = m_providers[0];
-        m_eahProviders[1] = m_providers[1];
-        m_eahProviders[2] = m_providers[2];
-        m_eahProviders[3] = m_providers[3];
-        m_eahProvidersInstances[0] = m_providersInstances[0];
-        m_eahProvidersInstances[1] = m_providersInstances[1];
-        m_eahProvidersInstances[2] = m_providersInstances[2];
-        m_eahProvidersInstances[3] = m_providersInstances[3];
-        m_synchronousDonutEventProvider = m_providers[3];
-
-        // All the consumers
-        m_consumersInstances = new ComponentInstance[NUMBER_OF_CONSUMERS];
-        m_consumersServices = new ServiceReference[NUMBER_OF_CONSUMERS];
-        m_consumers = new DonutConsumer[NUMBER_OF_CONSUMERS];
-        m_quickConsumers = new DonutConsumer[NUMBER_OF_QUICK_CONSUMERS];
-        m_filteredConsumersInstances = new ComponentInstance[Donut.FLAVOURS.length];
-        m_filteredConsumersServices = new ServiceReference[Donut.FLAVOURS.length];
-        m_filteredConsumers = new DonutConsumer[Donut.FLAVOURS.length];
-        m_topicsConsumersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsConsumersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsConsumers = new DonutConsumer[TOPICS_LIST.length];
-
-        // Create the (quick) donut consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut consumer");
-        m_consumersInstances[0] = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut event consumer");
-        m_consumersInstances[1] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick event consumer");
-        m_consumersInstances[2] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut consumer
-        properties = new Hashtable();
-        properties.put("slow", Boolean.TRUE);
-        properties.put("instance.name","slow donut consumer");
-        m_consumersInstances[3] = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow donut event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[4] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[5] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutConsumer.class.getName(),
-                    m_consumersInstances[i].getInstanceName());
-            m_consumers[i] = (DonutConsumer) getContext()
-                    .getService(m_consumersServices[i]);
-        }
-        m_quickConsumers[0] = m_consumers[0];
-        m_quickConsumers[1] = m_consumers[1];
-        m_quickConsumers[2] = m_consumers[2];
-
-        // Create the event tracker
-        properties = new Hashtable();
-        properties.put("instance.name","event tracker");
-        m_eventTrackerInstance = m_utils.getEventTrackerFactory()
-                .createComponentInstance(properties);
-        m_eventTrackerService = IPojoTestUtils.getServiceReferenceByName(
-                getContext(), EventTracker.class.getName(), m_eventTrackerInstance
-                        .getInstanceName());
-        m_eventTracker = (EventTracker) getContext()
-                .getService(m_eventTrackerService);
-
-        // Create the filtered consumer
-        Dictionary filter = new Hashtable();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            String flavour = Donut.FLAVOURS[i];
-            properties = new Hashtable();
-            filter.put("donut-event-subscriber", "(flavour=" + flavour + ")");
-            properties.put("instance.name",flavour + " donut consumer");
-            properties.put("event.filter", filter);
-            m_filteredConsumersInstances[i] = m_utils
-                    .getDonutEventConsumerFactory().createComponentInstance(
-                            properties);
-            m_filteredConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_filteredConsumersInstances[i]
-                            .getInstanceName());
-            m_filteredConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_filteredConsumersServices[i]);
-        }
-
-        // Create the providers and consumers selling and receiving donuts on
-        // specific topics
-        Dictionary topics = new Hashtable();
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            String topicsString = TOPICS_LIST[i];
-            properties = new Hashtable();
-            // Create provider
-            topics.put("donut-publisher", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut provider");
-            m_topicsProvidersInstances[i] = m_utils
-                    .getSynchronousDonutProviderFactory()
-                    .createComponentInstance(properties);
-            m_topicsProvidersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutProvider.class
-                            .getName(), m_topicsProvidersInstances[i]
-                            .getInstanceName());
-            m_topicsProviders[i] = (DonutProvider) getContext()
-                    .getService(m_topicsProvidersServices[i]);
-
-            // Create consumer
-            properties = new Hashtable();
-            topics.put("donut-subscriber", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut consumer");
-
-            m_topicsConsumersInstances[i] = m_utils.getDonutConsumerFactory()
-                    .createComponentInstance(properties);
-            m_topicsConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_topicsConsumersInstances[i]
-                            .getInstanceName());
-            m_topicsConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_topicsConsumersServices[i]);
-            topics.remove("donut-subscriber");
-        }
-
-        m_fooProvider = m_topicsProviders[0];
-        m_barProvider = m_topicsProviders[1];
-        m_nutProvider = m_topicsProviders[2];
-        m_fooBarProvider = m_topicsProviders[3];
-        m_barNutProvider = m_topicsProviders[4];
-        m_fooNutProvider = m_topicsProviders[5];
-        m_fooBarNutProvider = m_topicsProviders[6];
-        m_fooConsumer = m_topicsConsumers[0];
-        m_barConsumer = m_topicsConsumers[1];
-        m_nutConsumer = m_topicsConsumers[2];
-        m_fooBarConsumer = m_topicsConsumers[3];
-        m_barNutConsumer = m_topicsConsumers[4];
-        m_fooNutConsumer = m_topicsConsumers[5];
-        m_fooBarNutConsumer = m_topicsConsumers[6];
-
-    }
-    
-    /**
-     * Creates a subscriber listening on a pattern topic (ending with '*').
-     * @throws ConfigurationException something bad happened.
-     * @throws MissingHandlerException something bad happened.
-     * @throws UnacceptableConfiguration something bad happened.
-     */
-    public void testSubscriberWithPatternTopic() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-    	Dictionary properties = new Hashtable();
-    	Dictionary topics = new Hashtable();
-
-        // Create the donut consumer instance, listening on a pattern topic
-        properties.put("instance.name","subscriber with pattern topic");
-        topics.put("donut-subscriber", "a/pattern/topic/*");
-        properties.put("event.topics", topics);
-        
-        ComponentInstance instance = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-        instance.dispose();
-    }
-
-    /**
-     * Test the event handler reliability by sending events with all kinds of
-     * publisher and check they are received by all kinds of subscriber.
-     */
-    public void testReliability() {
-
-        // Flush donut list for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumers[i].clearDonuts();
-        }
-
-        // Send a lot of donut with each provider
-        List sentDonuts = new ArrayList(NUMBER_OF_PROVIDERS
-                * EahTestUtils.NUMBER_OF_TESTS);
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-                sentDonuts.add(m_providers[i].sellDonut());
-            }
-        }
-
-        // Wait a respectable amount of time
-        EahTestUtils.sleep(EahTestUtils.BLACK_LIST_TIME
-                + EahTestUtils.A_LONG_TIME);
-
-        // Collect all received donuts for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            List receivedDonuts = Arrays.asList(m_consumers[i].getAllDonuts());
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts.",
-                    sentDonuts.size(), receivedDonuts.size());
-            assertTrue("The receiver must have eaten all sent donuts.",
-                    receivedDonuts.containsAll(sentDonuts));
-        }
-    }
-
-    /**
-     * Test the synchronism of event sending for the component.
-     * 
-     * This test consists to send synchronously a big amount of donuts and to
-     * check immediately if it has been received (by all quick consumers).
-     */
-    public void testSynchronism() {
-
-        // Flush donut list for quick consumers
-        for (int i = 0; i < NUMBER_OF_QUICK_CONSUMERS; i++) {
-            m_quickConsumers[i].clearDonuts();
-        }
-
-        // Send a lot of donuts and check they are immediately received.
-        Donut sentDonut;
-        Donut receivedDonut;
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            for (int j = 0; j < NUMBER_OF_SYNCHRONOUS_PROVIDERS; j++) {
-                sentDonut = m_synchronousProviders[j].sellDonut();
-                for (int k = 0; k < NUMBER_OF_QUICK_CONSUMERS; k++) {
-                    receivedDonut = m_quickConsumers[k].getDonut();
-                    assertEquals(
-                            "The donut must have been received immediately and be the be the same as the sent one.",
-                            sentDonut, receivedDonut);
-                }
-            }
-        }
-    }
-
-    /**
-     * Test that the received events contains the instance name of the sender.
-     */
-    public void testInstanceName() {
-
-        // Flush event list of the event tracker
-        m_eventTracker.clearEvents();
-
-        // Send donuts and check the sender instance name
-        Event receivedEvent;
-        for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) {
-            m_eahProviders[i].sellDonut();
-            receivedEvent = m_eventTracker.waitForEvent();
-            assertEquals(
-                    "The instance name property of the received message must be the same as the sender instance name.",
-                    m_eahProvidersInstances[i].getInstanceName(), receivedEvent
-                            .getProperty("publisher.instance.name"));
-        }
-    }
-
-    /**
-     * Test the event filtering.
-     * 
-     * This test send donuts with different flavours. Each filtered consumer
-     * must receive only a certain kind of donut. Of course, all donuts must
-     * have been received too.
-     */
-    public void testFilters() {
-
-        // The sent donuts, sorted by flavour
-        List[] sentDonuts = new List[Donut.FLAVOURS.length];
-
-        // Flush donut list for each filtered consumer
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            m_filteredConsumers[i].clearDonuts();
-            sentDonuts[i] = new ArrayList(EahTestUtils.NUMBER_OF_TESTS
-                    / Donut.FLAVOURS.length);
-        }
-
-        // Send donuts
-        for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-            Donut donut = m_synchronousDonutEventProvider.sellDonut();
-            sentDonuts[EahTestUtils.flavourIndex(donut.getFlavour())]
-                    .add(donut);
-        }
-
-        // Check the received donuts
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            Donut[] receivedDonuts = m_filteredConsumers[i].getAllDonuts();
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts with the matching flavour.",
-                    sentDonuts[i].size(), receivedDonuts.length);
-            assertTrue(
-                    "The receiver must have eaten all sent donuts matching the wanted flavour.",
-                    Arrays.asList(receivedDonuts).containsAll(sentDonuts[i]));
-        }
-
-    }
-
-    /**
-     * Test the event topic.
-     * 
-     * This test send donuts on several topics. Each consumer (who listens to
-     * one or several topics) must receive donuts sent on his specifics topics.
-     */
-    public void testTopics() {
-
-        // The sent donuts, sorted by topic
-        int foos = 0;
-        int bars = 0;
-        int nuts = 0;
-
-        // Flush consumers
-        m_fooConsumer.clearDonuts();
-        m_barConsumer.clearDonuts();
-        m_nutConsumer.clearDonuts();
-        m_fooBarConsumer.clearDonuts();
-        m_barNutConsumer.clearDonuts();
-        m_fooNutConsumer.clearDonuts();
-        m_fooBarNutConsumer.clearDonuts();
-
-        // Send donuts
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            m_fooProvider.sellDonut();
-            foos++;
-
-            m_barProvider.sellDonut();
-            bars++;
-
-            m_nutProvider.sellDonut();
-            nuts++;
-
-            m_fooBarProvider.sellDonut();
-            foos++;
-            bars++;
-
-            m_barNutProvider.sellDonut();
-            bars++;
-            nuts++;
-
-            m_fooNutProvider.sellDonut();
-            foos++;
-            nuts++;
-
-            m_fooBarNutProvider.sellDonut();
-            foos++;
-            bars++;
-            nuts++;
-        }
-
-        // Check received donuts
-        assertEquals("The number of received donuts must be correct.", foos,
-                m_fooConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars,
-                m_barConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", nuts,
-                m_nutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars, m_fooBarConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars
-                + nuts, m_barNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + nuts, m_fooNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars + nuts, m_fooBarNutConsumer.getAllDonuts().length);
-
-    }
-
-    /**
-     * Finalization after test cases.
-     * 
-     * Release all services references and destroy instances.
-     */
-    public void tearDown() {
-        int index;
-        for (index = 0; index < NUMBER_OF_PROVIDERS; index++) {
-            getContext().ungetService(m_providersServices[index]);
-            m_providersInstances[index].dispose();
-        }
-        for (index = 0; index < NUMBER_OF_CONSUMERS; index++) {
-            getContext().ungetService(m_consumersServices[index]);
-            m_consumersInstances[index].dispose();
-        }
-        getContext().ungetService(m_eventTrackerService);
-        m_eventTrackerInstance.dispose();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            getContext().ungetService(m_filteredConsumersServices[i]);
-            m_filteredConsumersInstances[i].dispose();
-        }
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            getContext().ungetService(m_topicsProvidersServices[i]);
-            m_topicsProvidersInstances[i].dispose();
-            getContext().ungetService(m_topicsConsumersServices[i]);
-            m_topicsConsumersInstances[i].dispose();
-        }
-
-    }
-
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTestsWithNewAttributes.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTestsWithNewAttributes.java
deleted file mode 100644
index 1cdea8d..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/GoodTestsWithNewAttributes.java
+++ /dev/null
@@ -1,746 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
-
-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.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.donut.Donut;
-import org.apache.felix.ipojo.test.donut.DonutConsumer;
-import org.apache.felix.ipojo.test.donut.DonutProvider;
-import org.apache.felix.ipojo.test.donut.EventTracker;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.apache.felix.ipojo.test.util.IPojoTestUtils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.event.Event;
-
-/**
- * Test the good behaviour of the EventAdminHandler.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class GoodTestsWithNewAttributes extends OSGiTestCase {
-
-    /**
-     * The number of providers to test.
-     */
-    private static final int NUMBER_OF_PROVIDERS = 6;
-
-    /**
-     * The number of providers using the event admin handler to test.
-     */
-    private static final int NUMBER_OF_EAH_PROVIDERS = 4;
-
-    /**
-     * The number of consumers to test.
-     */
-    private static final int NUMBER_OF_CONSUMERS = 6;
-
-    /**
-     * The number of synchronous providers to test.
-     */
-    private static final int NUMBER_OF_SYNCHRONOUS_PROVIDERS = 3;
-
-    /**
-     * The number of slow consumers to test.
-     */
-    private static final int NUMBER_OF_QUICK_CONSUMERS = 3;
-
-    /**
-     * The list of topics to test.
-     */
-    private static final String[] TOPICS_LIST = { "foo", "bar", "nut",
-        "foo,bar", "bar,nut", "foo,nut", "foo,bar,nut" };
-
-    /**
-     * The utility class instance.
-     */
-    public EahTestUtils m_utils;
-
-    /**
-     * The providers' instances.
-     */
-    private ComponentInstance[] m_providersInstances;
-
-    /**
-     * The providers' service references.
-     */
-    private ServiceReference[] m_providersServices;
-
-    /**
-     * The providers' services.
-     */
-    private DonutProvider[] m_providers;
-
-    /**
-     * The synchronous providers' services.
-     */
-    private DonutProvider[] m_synchronousProviders;
-
-    /**
-     * The instances of providers that uses the event admin handler.
-     */
-    private ComponentInstance[] m_eahProvidersInstances;
-
-    /**
-     * The services of the providers that uses the event admin handler.
-     */
-    private DonutProvider[] m_eahProviders;
-
-    /**
-     * The synchronous donut event provider service.
-     */
-    private DonutProvider m_synchronousDonutEventProvider;
-
-    /**
-     * The consumers' instances.
-     */
-    private ComponentInstance[] m_consumersInstances;
-
-    /**
-     * The consumers' service references.
-     */
-    private ServiceReference[] m_consumersServices;
-
-    /**
-     * The consumers' services.
-     */
-    private DonutConsumer[] m_consumers;
-
-    /**
-     * The slow consumers' services.
-     */
-    private DonutConsumer[] m_quickConsumers;
-
-    /**
-     * The event tracker' instances.
-     */
-    private ComponentInstance m_eventTrackerInstance;
-
-    /**
-     * The event tracker' service references.
-     */
-    private ServiceReference m_eventTrackerService;
-
-    /**
-     * The event tracker service.
-     */
-    private EventTracker m_eventTracker;
-
-    /**
-     * The filtered consumers' instances.
-     */
-    private ComponentInstance[] m_filteredConsumersInstances;
-
-    /**
-     * The filtered consumers' service references.
-     */
-    private ServiceReference[] m_filteredConsumersServices;
-
-    /**
-     * The filtered consumers' services.
-     */
-    private DonutConsumer[] m_filteredConsumers;
-
-    /**
-     * The providers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsProvidersInstances;
-
-    /**
-     * The providers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsProvidersServices;
-
-    /**
-     * The providers' service with specified topics.
-     */
-    private DonutProvider[] m_topicsProviders;
-
-    /**
-     * The provider that send donuts on the "foo" topic.
-     */
-    private DonutProvider m_fooProvider;
-
-    /**
-     * The provider that send donuts on the "bar" topic.
-     */
-    private DonutProvider m_barProvider;
-
-    /**
-     * The provider that send donuts on the "nut" topic.
-     */
-    private DonutProvider m_nutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar" topics.
-     */
-    private DonutProvider m_fooBarProvider;
-
-    /**
-     * The provider that send donuts on the "bar,nut" topics.
-     */
-    private DonutProvider m_barNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,nut" topics.
-     */
-    private DonutProvider m_fooNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar,nut" topics.
-     */
-    private DonutProvider m_fooBarNutProvider;
-
-    /**
-     * The consumers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsConsumersInstances;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsConsumersServices;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private DonutConsumer[] m_topicsConsumers;
-
-    /**
-     * The consumer that receive donuts on the "foo" topic.
-     */
-    private DonutConsumer m_fooConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar" topic.
-     */
-    private DonutConsumer m_barConsumer;
-
-    /**
-     * The consumer that receive donuts on the "nut" topic.
-     */
-    private DonutConsumer m_nutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar" topics.
-     */
-    private DonutConsumer m_fooBarConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar,nut" topics.
-     */
-    private DonutConsumer m_barNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,nut" topics.
-     */
-    private DonutConsumer m_fooNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar,nut" topics.
-     */
-    private DonutConsumer m_fooBarNutConsumer;
-
-    /**
-     * Initialization before test cases.
-     *
-     * Create all the instances
-     *
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws ConfigurationException
-     *             something bad happened
-     *
-     */
-    public void setUp()
-        throws UnacceptableConfiguration, MissingHandlerException,
-        ConfigurationException {
-
-        m_utils = new EahTestUtils(getContext());
-        Dictionary properties = new Hashtable();
-
-        // All the providers
-        m_providersInstances = new ComponentInstance[NUMBER_OF_PROVIDERS];
-        m_providersServices = new ServiceReference[NUMBER_OF_PROVIDERS];
-        m_providers = new DonutProvider[NUMBER_OF_PROVIDERS];
-        m_synchronousProviders = new DonutProvider[NUMBER_OF_SYNCHRONOUS_PROVIDERS];
-        m_eahProviders = new DonutProvider[NUMBER_OF_EAH_PROVIDERS];
-        m_eahProvidersInstances = new ComponentInstance[NUMBER_OF_EAH_PROVIDERS];
-        m_topicsProvidersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsProvidersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsProviders = new DonutProvider[TOPICS_LIST.length];
-
-        // Create the (asynchronous) donut provider
-        properties.put("instance.name","asynchronous donut provider");
-        m_providersInstances[0] = m_utils.getDonutProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut provider");
-        m_providersInstances[1] = m_utils.getSynchronousDonutProvider2Factory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous donut event provider");
-        m_providersInstances[2] = m_utils.getDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut event provider");
-        m_providersInstances[3] = m_utils
-                .getSynchronousDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous event provider");
-        m_providersInstances[4] = m_utils.getEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous event provider");
-        m_providersInstances[5] = m_utils.getSynchronousEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            m_providersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutProvider.class.getName(),
-                    m_providersInstances[i].getInstanceName());
-            m_providers[i] = (DonutProvider) getContext()
-                    .getService(m_providersServices[i]);
-        }
-        m_synchronousProviders[0] = m_providers[1];
-        m_synchronousProviders[1] = m_providers[3];
-        m_synchronousProviders[2] = m_providers[5];
-        m_eahProviders[0] = m_providers[0];
-        m_eahProviders[1] = m_providers[1];
-        m_eahProviders[2] = m_providers[2];
-        m_eahProviders[3] = m_providers[3];
-        m_eahProvidersInstances[0] = m_providersInstances[0];
-        m_eahProvidersInstances[1] = m_providersInstances[1];
-        m_eahProvidersInstances[2] = m_providersInstances[2];
-        m_eahProvidersInstances[3] = m_providersInstances[3];
-        m_synchronousDonutEventProvider = m_providers[3];
-
-        // All the consumers
-        m_consumersInstances = new ComponentInstance[NUMBER_OF_CONSUMERS];
-        m_consumersServices = new ServiceReference[NUMBER_OF_CONSUMERS];
-        m_consumers = new DonutConsumer[NUMBER_OF_CONSUMERS];
-        m_quickConsumers = new DonutConsumer[NUMBER_OF_QUICK_CONSUMERS];
-        m_filteredConsumersInstances = new ComponentInstance[Donut.FLAVOURS.length];
-        m_filteredConsumersServices = new ServiceReference[Donut.FLAVOURS.length];
-        m_filteredConsumers = new DonutConsumer[Donut.FLAVOURS.length];
-        m_topicsConsumersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsConsumersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsConsumers = new DonutConsumer[TOPICS_LIST.length];
-
-        // Create the (quick) donut consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut consumer");
-        m_consumersInstances[0] = m_utils.getDonutConsumer2Factory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut event consumer");
-        m_consumersInstances[1] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick event consumer");
-        m_consumersInstances[2] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut consumer
-        properties = new Hashtable();
-        properties.put("slow", Boolean.TRUE);
-        properties.put("instance.name","slow donut consumer");
-        m_consumersInstances[3] = m_utils.getDonutConsumer2Factory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow donut event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[4] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[5] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutConsumer.class.getName(),
-                    m_consumersInstances[i].getInstanceName());
-            m_consumers[i] = (DonutConsumer) getContext()
-                    .getService(m_consumersServices[i]);
-        }
-        m_quickConsumers[0] = m_consumers[0];
-        m_quickConsumers[1] = m_consumers[1];
-        m_quickConsumers[2] = m_consumers[2];
-
-        // Create the event tracker
-        properties = new Hashtable();
-        properties.put("instance.name","event tracker");
-        m_eventTrackerInstance = m_utils.getEventTrackerFactory()
-                .createComponentInstance(properties);
-        m_eventTrackerService = IPojoTestUtils.getServiceReferenceByName(
-                getContext(), EventTracker.class.getName(), m_eventTrackerInstance
-                        .getInstanceName());
-        m_eventTracker = (EventTracker) getContext()
-                .getService(m_eventTrackerService);
-
-        // Create the filtered consumer
-        Dictionary filter = new Hashtable();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            String flavour = Donut.FLAVOURS[i];
-            properties = new Hashtable();
-            filter.put("donut-event-subscriber", "(flavour=" + flavour + ")");
-            properties.put("instance.name",flavour + " donut consumer");
-            properties.put("event.filter", filter);
-            m_filteredConsumersInstances[i] = m_utils
-                    .getDonutEventConsumerFactory().createComponentInstance(
-                            properties);
-            m_filteredConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_filteredConsumersInstances[i]
-                            .getInstanceName());
-            m_filteredConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_filteredConsumersServices[i]);
-        }
-
-        // Create the providers and consumers selling and receiving donuts on
-        // specific topics
-        Dictionary topics = new Hashtable();
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            String topicsString = TOPICS_LIST[i];
-            properties = new Hashtable();
-            // Create provider
-            topics.put("donut-publisher", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut provider");
-            m_topicsProvidersInstances[i] = m_utils
-                    .getSynchronousDonutProviderFactory()
-                    .createComponentInstance(properties);
-            m_topicsProvidersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutProvider.class
-                            .getName(), m_topicsProvidersInstances[i]
-                            .getInstanceName());
-            m_topicsProviders[i] = (DonutProvider) getContext()
-                    .getService(m_topicsProvidersServices[i]);
-
-            // Create consumer
-            properties = new Hashtable();
-            topics.put("donut-subscriber", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut consumer");
-
-            m_topicsConsumersInstances[i] = m_utils.getDonutConsumer2Factory()
-                    .createComponentInstance(properties);
-            m_topicsConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_topicsConsumersInstances[i]
-                            .getInstanceName());
-            m_topicsConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_topicsConsumersServices[i]);
-            topics.remove("donut-subscriber");
-        }
-
-        m_fooProvider = m_topicsProviders[0];
-        m_barProvider = m_topicsProviders[1];
-        m_nutProvider = m_topicsProviders[2];
-        m_fooBarProvider = m_topicsProviders[3];
-        m_barNutProvider = m_topicsProviders[4];
-        m_fooNutProvider = m_topicsProviders[5];
-        m_fooBarNutProvider = m_topicsProviders[6];
-        m_fooConsumer = m_topicsConsumers[0];
-        m_barConsumer = m_topicsConsumers[1];
-        m_nutConsumer = m_topicsConsumers[2];
-        m_fooBarConsumer = m_topicsConsumers[3];
-        m_barNutConsumer = m_topicsConsumers[4];
-        m_fooNutConsumer = m_topicsConsumers[5];
-        m_fooBarNutConsumer = m_topicsConsumers[6];
-
-    }
-
-    /**
-     * Creates a subscriber listening on a pattern topic (ending with '*').
-     * @throws ConfigurationException something bad happened.
-     * @throws MissingHandlerException something bad happened.
-     * @throws UnacceptableConfiguration something bad happened.
-     */
-    public void testSubscriberWithPatternTopic() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-    	Dictionary properties = new Hashtable();
-    	Dictionary topics = new Hashtable();
-
-        // Create the donut consumer instance, listening on a pattern topic
-        properties.put("instance.name","subscriber with pattern topic");
-        topics.put("donut-subscriber", "a/pattern/topic/*");
-        properties.put("event.topics", topics);
-
-        ComponentInstance instance = m_utils.getDonutConsumer2Factory()
-                .createComponentInstance(properties);
-        instance.dispose();
-    }
-
-    /**
-     * Test the event handler reliability by sending events with all kinds of
-     * publisher and check they are received by all kinds of subscriber.
-     */
-    public void testReliability() {
-
-        // Flush donut list for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumers[i].clearDonuts();
-        }
-
-        // Send a lot of donut with each provider
-        List sentDonuts = new ArrayList(NUMBER_OF_PROVIDERS
-                * EahTestUtils.NUMBER_OF_TESTS);
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-                sentDonuts.add(m_providers[i].sellDonut());
-            }
-        }
-
-        // Wait a respectable amount of time
-        EahTestUtils.sleep(EahTestUtils.BLACK_LIST_TIME
-                + EahTestUtils.A_LONG_TIME);
-
-        // Collect all received donuts for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            List receivedDonuts = Arrays.asList(m_consumers[i].getAllDonuts());
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts.",
-                    sentDonuts.size(), receivedDonuts.size());
-            assertTrue("The receiver must have eaten all sent donuts.",
-                    receivedDonuts.containsAll(sentDonuts));
-        }
-    }
-
-    /**
-     * Test the synchronism of event sending for the component.
-     *
-     * This test consists to send synchronously a big amount of donuts and to
-     * check immediately if it has been received (by all quick consumers).
-     */
-    public void testSynchronism() {
-
-        // Flush donut list for quick consumers
-        for (int i = 0; i < NUMBER_OF_QUICK_CONSUMERS; i++) {
-            m_quickConsumers[i].clearDonuts();
-        }
-
-        // Send a lot of donuts and check they are immediately received.
-        Donut sentDonut;
-        Donut receivedDonut;
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            for (int j = 0; j < NUMBER_OF_SYNCHRONOUS_PROVIDERS; j++) {
-                sentDonut = m_synchronousProviders[j].sellDonut();
-                for (int k = 0; k < NUMBER_OF_QUICK_CONSUMERS; k++) {
-                    receivedDonut = m_quickConsumers[k].getDonut();
-                    assertEquals(
-                            "The donut must have been received immediately and be the be the same as the sent one.",
-                            sentDonut, receivedDonut);
-                }
-            }
-        }
-    }
-
-    /**
-     * Test that the received events contains the instance name of the sender.
-     */
-    public void testInstanceName() {
-
-        // Flush event list of the event tracker
-        m_eventTracker.clearEvents();
-
-        // Send donuts and check the sender instance name
-        Event receivedEvent;
-        for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) {
-            m_eahProviders[i].sellDonut();
-            receivedEvent = m_eventTracker.waitForEvent();
-            assertEquals(
-                    "The instance name property of the received message must be the same as the sender instance name.",
-                    m_eahProvidersInstances[i].getInstanceName(), receivedEvent
-                            .getProperty("publisher.instance.name"));
-        }
-    }
-
-    /**
-     * Test the event filtering.
-     *
-     * This test send donuts with different flavours. Each filtered consumer
-     * must receive only a certain kind of donut. Of course, all donuts must
-     * have been received too.
-     */
-    public void testFilters() {
-
-        // The sent donuts, sorted by flavour
-        List[] sentDonuts = new List[Donut.FLAVOURS.length];
-
-        // Flush donut list for each filtered consumer
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            m_filteredConsumers[i].clearDonuts();
-            sentDonuts[i] = new ArrayList(EahTestUtils.NUMBER_OF_TESTS
-                    / Donut.FLAVOURS.length);
-        }
-
-        // Send donuts
-        for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-            Donut donut = m_synchronousDonutEventProvider.sellDonut();
-            sentDonuts[EahTestUtils.flavourIndex(donut.getFlavour())]
-                    .add(donut);
-        }
-
-        // Check the received donuts
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            Donut[] receivedDonuts = m_filteredConsumers[i].getAllDonuts();
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts with the matching flavour.",
-                    sentDonuts[i].size(), receivedDonuts.length);
-            assertTrue(
-                    "The receiver must have eaten all sent donuts matching the wanted flavour.",
-                    Arrays.asList(receivedDonuts).containsAll(sentDonuts[i]));
-        }
-
-    }
-
-    /**
-     * Test the event topic.
-     *
-     * This test send donuts on several topics. Each consumer (who listens to
-     * one or several topics) must receive donuts sent on his specifics topics.
-     */
-    public void testTopics() {
-
-        // The sent donuts, sorted by topic
-        int foos = 0;
-        int bars = 0;
-        int nuts = 0;
-
-        // Flush consumers
-        m_fooConsumer.clearDonuts();
-        m_barConsumer.clearDonuts();
-        m_nutConsumer.clearDonuts();
-        m_fooBarConsumer.clearDonuts();
-        m_barNutConsumer.clearDonuts();
-        m_fooNutConsumer.clearDonuts();
-        m_fooBarNutConsumer.clearDonuts();
-
-        // Send donuts
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            m_fooProvider.sellDonut();
-            foos++;
-
-            m_barProvider.sellDonut();
-            bars++;
-
-            m_nutProvider.sellDonut();
-            nuts++;
-
-            m_fooBarProvider.sellDonut();
-            foos++;
-            bars++;
-
-            m_barNutProvider.sellDonut();
-            bars++;
-            nuts++;
-
-            m_fooNutProvider.sellDonut();
-            foos++;
-            nuts++;
-
-            m_fooBarNutProvider.sellDonut();
-            foos++;
-            bars++;
-            nuts++;
-        }
-
-        // Check received donuts
-        assertEquals("The number of received donuts must be correct.", foos,
-                m_fooConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars,
-                m_barConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", nuts,
-                m_nutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars, m_fooBarConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars
-                + nuts, m_barNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + nuts, m_fooNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars + nuts, m_fooBarNutConsumer.getAllDonuts().length);
-
-    }
-
-    /**
-     * Finalization after test cases.
-     *
-     * Release all services references and destroy instances.
-     */
-    public void tearDown() {
-        int index;
-        for (index = 0; index < NUMBER_OF_PROVIDERS; index++) {
-            getContext().ungetService(m_providersServices[index]);
-            m_providersInstances[index].dispose();
-        }
-        for (index = 0; index < NUMBER_OF_CONSUMERS; index++) {
-            getContext().ungetService(m_consumersServices[index]);
-            m_consumersInstances[index].dispose();
-        }
-        getContext().ungetService(m_eventTrackerService);
-        m_eventTrackerInstance.dispose();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            getContext().ungetService(m_filteredConsumersServices[i]);
-            m_filteredConsumersInstances[i].dispose();
-        }
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            getContext().ungetService(m_topicsProvidersServices[i]);
-            m_topicsProvidersInstances[i].dispose();
-            getContext().ungetService(m_topicsConsumersServices[i]);
-            m_topicsConsumersInstances[i].dispose();
-        }
-
-    }
-
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/PublishesTests.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/PublishesTests.java
deleted file mode 100644
index 0e3f6e9..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/PublishesTests.java
+++ /dev/null
@@ -1,766 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.donut.Donut;
-import org.apache.felix.ipojo.test.donut.DonutConsumer;
-import org.apache.felix.ipojo.test.donut.DonutProvider;
-import org.apache.felix.ipojo.test.donut.EventTracker;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.apache.felix.ipojo.test.util.IPojoTestUtils;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.event.Event;
-
-/**
- * Test the good behaviour of the EventAdminHandler.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class PublishesTests extends OSGiTestCase {
-
-    /**
-     * The number of providers to test.
-     */
-    private static final int NUMBER_OF_PROVIDERS = 6;
-
-    /**
-     * The number of providers using the event admin handler to test.
-     */
-    private static final int NUMBER_OF_EAH_PROVIDERS = 4;
-
-    /**
-     * The number of consumers to test.
-     */
-    private static final int NUMBER_OF_CONSUMERS = 6;
-
-    /**
-     * The number of synchronous providers to test.
-     */
-    private static final int NUMBER_OF_SYNCHRONOUS_PROVIDERS = 3;
-
-    /**
-     * The number of slow consumers to test.
-     */
-    private static final int NUMBER_OF_QUICK_CONSUMERS = 3;
-
-    /**
-     * The list of topics to test.
-     */
-    private static final String[] TOPICS_LIST = { "foo", "bar", "nut",
-        "foo,bar", "bar,nut", "foo,nut", "foo,bar,nut" };
-
-    /**
-     * The utility class instance.
-     */
-    public EahTestUtils m_utils;
-
-    /**
-     * The providers' instances.
-     */
-    private ComponentInstance[] m_providersInstances;
-
-    /**
-     * The providers' service references.
-     */
-    private ServiceReference[] m_providersServices;
-
-    /**
-     * The providers' services.
-     */
-    private DonutProvider[] m_providers;
-
-    /**
-     * The synchronous providers' services.
-     */
-    private DonutProvider[] m_synchronousProviders;
-
-    /**
-     * The instances of providers that uses the event admin handler.
-     */
-    private ComponentInstance[] m_eahProvidersInstances;
-
-    /**
-     * The services of the providers that uses the event admin handler.
-     */
-    private DonutProvider[] m_eahProviders;
-
-    /**
-     * The synchronous donut event provider service.
-     */
-    private DonutProvider m_synchronousDonutEventProvider;
-
-    /**
-     * The consumers' instances.
-     */
-    private ComponentInstance[] m_consumersInstances;
-
-    /**
-     * The consumers' service references.
-     */
-    private ServiceReference[] m_consumersServices;
-
-    /**
-     * The consumers' services.
-     */
-    private DonutConsumer[] m_consumers;
-
-    /**
-     * The slow consumers' services.
-     */
-    private DonutConsumer[] m_quickConsumers;
-
-    /**
-     * The event tracker' instances.
-     */
-    private ComponentInstance m_eventTrackerInstance;
-
-    /**
-     * The event tracker' service references.
-     */
-    private ServiceReference m_eventTrackerService;
-
-    /**
-     * The event tracker service.
-     */
-    private EventTracker m_eventTracker;
-
-    /**
-     * The filtered consumers' instances.
-     */
-    private ComponentInstance[] m_filteredConsumersInstances;
-
-    /**
-     * The filtered consumers' service references.
-     */
-    private ServiceReference[] m_filteredConsumersServices;
-
-    /**
-     * The filtered consumers' services.
-     */
-    private DonutConsumer[] m_filteredConsumers;
-
-    /**
-     * The providers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsProvidersInstances;
-
-    /**
-     * The providers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsProvidersServices;
-
-    /**
-     * The providers' service with specified topics.
-     */
-    private DonutProvider[] m_topicsProviders;
-
-    /**
-     * The provider that send donuts on the "foo" topic.
-     */
-    private DonutProvider m_fooProvider;
-
-    /**
-     * The provider that send donuts on the "bar" topic.
-     */
-    private DonutProvider m_barProvider;
-
-    /**
-     * The provider that send donuts on the "nut" topic.
-     */
-    private DonutProvider m_nutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar" topics.
-     */
-    private DonutProvider m_fooBarProvider;
-
-    /**
-     * The provider that send donuts on the "bar,nut" topics.
-     */
-    private DonutProvider m_barNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,nut" topics.
-     */
-    private DonutProvider m_fooNutProvider;
-
-    /**
-     * The provider that send donuts on the "foo,bar,nut" topics.
-     */
-    private DonutProvider m_fooBarNutProvider;
-
-    /**
-     * The consumers' instances with specified topics.
-     */
-    private ComponentInstance[] m_topicsConsumersInstances;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private ServiceReference[] m_topicsConsumersServices;
-
-    /**
-     * The consumers' service references with specified topics.
-     */
-    private DonutConsumer[] m_topicsConsumers;
-
-    /**
-     * The consumer that receive donuts on the "foo" topic.
-     */
-    private DonutConsumer m_fooConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar" topic.
-     */
-    private DonutConsumer m_barConsumer;
-
-    /**
-     * The consumer that receive donuts on the "nut" topic.
-     */
-    private DonutConsumer m_nutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar" topics.
-     */
-    private DonutConsumer m_fooBarConsumer;
-
-    /**
-     * The consumer that receive donuts on the "bar,nut" topics.
-     */
-    private DonutConsumer m_barNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,nut" topics.
-     */
-    private DonutConsumer m_fooNutConsumer;
-
-    /**
-     * The consumer that receive donuts on the "foo,bar,nut" topics.
-     */
-    private DonutConsumer m_fooBarNutConsumer;
-
-    /**
-     * Initialization before test cases.
-     *
-     * Create all the instances
-     *
-     * @throws UnacceptableConfiguration
-     *             something bad happened
-     * @throws MissingHandlerException
-     *             something bad happened
-     * @throws ConfigurationException
-     *             something bad happened
-     *
-     */
-    public void setUp()
-        throws UnacceptableConfiguration, MissingHandlerException,
-        ConfigurationException {
-
-        m_utils = new EahTestUtils(getContext());
-        Dictionary properties = new Hashtable();
-
-        // All the providers
-        m_providersInstances = new ComponentInstance[NUMBER_OF_PROVIDERS];
-        m_providersServices = new ServiceReference[NUMBER_OF_PROVIDERS];
-        m_providers = new DonutProvider[NUMBER_OF_PROVIDERS];
-        m_synchronousProviders = new DonutProvider[NUMBER_OF_SYNCHRONOUS_PROVIDERS];
-        m_eahProviders = new DonutProvider[NUMBER_OF_EAH_PROVIDERS];
-        m_eahProvidersInstances = new ComponentInstance[NUMBER_OF_EAH_PROVIDERS];
-        m_topicsProvidersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsProvidersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsProviders = new DonutProvider[TOPICS_LIST.length];
-
-        // Create the (asynchronous) donut provider
-        properties.put("instance.name","asynchronous donut provider");
-        m_providersInstances[0] = m_utils.getDonutProviderUsingPublishesFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut provider");
-        m_providersInstances[1] = m_utils.getSynchronousDonutProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous donut event provider");
-        m_providersInstances[2] = m_utils.getDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous donut event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous donut event provider");
-        m_providersInstances[3] = m_utils
-                .getSynchronousDonutEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the (asynchronous) event provider
-        properties = new Hashtable();
-        properties.put("instance.name","asynchronous event provider");
-        m_providersInstances[4] = m_utils.getEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Create the synchronous event provider
-        properties = new Hashtable();
-        properties.put("instance.name","synchronous event provider");
-        m_providersInstances[5] = m_utils.getSynchronousEventProviderFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            m_providersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutProvider.class.getName(),
-                    m_providersInstances[i].getInstanceName());
-            m_providers[i] = (DonutProvider) getContext()
-                    .getService(m_providersServices[i]);
-        }
-        m_synchronousProviders[0] = m_providers[1];
-        m_synchronousProviders[1] = m_providers[3];
-        m_synchronousProviders[2] = m_providers[5];
-        m_eahProviders[0] = m_providers[0];
-        m_eahProviders[1] = m_providers[1];
-        m_eahProviders[2] = m_providers[2];
-        m_eahProviders[3] = m_providers[3];
-        m_eahProvidersInstances[0] = m_providersInstances[0];
-        m_eahProvidersInstances[1] = m_providersInstances[1];
-        m_eahProvidersInstances[2] = m_providersInstances[2];
-        m_eahProvidersInstances[3] = m_providersInstances[3];
-        m_synchronousDonutEventProvider = m_providers[3];
-
-        // All the consumers
-        m_consumersInstances = new ComponentInstance[NUMBER_OF_CONSUMERS];
-        m_consumersServices = new ServiceReference[NUMBER_OF_CONSUMERS];
-        m_consumers = new DonutConsumer[NUMBER_OF_CONSUMERS];
-        m_quickConsumers = new DonutConsumer[NUMBER_OF_QUICK_CONSUMERS];
-        m_filteredConsumersInstances = new ComponentInstance[Donut.FLAVOURS.length];
-        m_filteredConsumersServices = new ServiceReference[Donut.FLAVOURS.length];
-        m_filteredConsumers = new DonutConsumer[Donut.FLAVOURS.length];
-        m_topicsConsumersInstances = new ComponentInstance[TOPICS_LIST.length];
-        m_topicsConsumersServices = new ServiceReference[TOPICS_LIST.length];
-        m_topicsConsumers = new DonutConsumer[TOPICS_LIST.length];
-
-        // Create the (quick) donut consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut consumer");
-        m_consumersInstances[0] = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick donut event consumer");
-        m_consumersInstances[1] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the (quick) event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","quick event consumer");
-        m_consumersInstances[2] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut consumer
-        properties = new Hashtable();
-        properties.put("slow", Boolean.TRUE);
-        properties.put("instance.name","slow donut consumer");
-        m_consumersInstances[3] = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow donut event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow donut event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[4] = m_utils.getDonutEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Create the slow event consumer
-        properties = new Hashtable();
-        properties.put("instance.name","slow event consumer");
-        properties.put("slow", Boolean.TRUE);
-        m_consumersInstances[5] = m_utils.getEventConsumerFactory()
-                .createComponentInstance(properties);
-
-        // Get all the services references
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumersServices[i] = IPojoTestUtils.getServiceReferenceByName(
-                    getContext(), DonutConsumer.class.getName(),
-                    m_consumersInstances[i].getInstanceName());
-            m_consumers[i] = (DonutConsumer) getContext()
-                    .getService(m_consumersServices[i]);
-        }
-        m_quickConsumers[0] = m_consumers[0];
-        m_quickConsumers[1] = m_consumers[1];
-        m_quickConsumers[2] = m_consumers[2];
-
-        // Create the event tracker
-        properties = new Hashtable();
-        properties.put("instance.name","event tracker");
-        m_eventTrackerInstance = m_utils.getEventTrackerFactory()
-                .createComponentInstance(properties);
-        m_eventTrackerService = IPojoTestUtils.getServiceReferenceByName(
-                getContext(), EventTracker.class.getName(), m_eventTrackerInstance
-                        .getInstanceName());
-        m_eventTracker = (EventTracker) getContext()
-                .getService(m_eventTrackerService);
-
-        // Create the filtered consumer
-        Dictionary filter = new Hashtable();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            String flavour = Donut.FLAVOURS[i];
-            properties = new Hashtable();
-            filter.put("donut-event-subscriber", "(flavour=" + flavour + ")");
-            properties.put("instance.name",flavour + " donut consumer");
-            properties.put("event.filter", filter);
-            m_filteredConsumersInstances[i] = m_utils
-                    .getDonutEventConsumerFactory().createComponentInstance(
-                            properties);
-            m_filteredConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_filteredConsumersInstances[i]
-                            .getInstanceName());
-            m_filteredConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_filteredConsumersServices[i]);
-        }
-
-        // Create the providers and consumers selling and receiving donuts on
-        // specific topics
-        Dictionary topics = new Hashtable();
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            String topicsString = TOPICS_LIST[i];
-            properties = new Hashtable();
-            // Create provider
-            topics.put("donut-publisher", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut provider");
-            m_topicsProvidersInstances[i] = m_utils
-                    .getSynchronousDonutProviderFactory()
-                    .createComponentInstance(properties);
-            m_topicsProvidersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutProvider.class
-                            .getName(), m_topicsProvidersInstances[i]
-                            .getInstanceName());
-            m_topicsProviders[i] = (DonutProvider) getContext()
-                    .getService(m_topicsProvidersServices[i]);
-
-            // Create consumer
-            properties = new Hashtable();
-            topics.put("donut-subscriber", topicsString);
-            properties.put("event.topics", topics);
-            properties.put("instance.name",topicsString + " donut consumer");
-
-            m_topicsConsumersInstances[i] = m_utils.getDonutConsumerFactory()
-                    .createComponentInstance(properties);
-            m_topicsConsumersServices[i] = IPojoTestUtils
-                    .getServiceReferenceByName(getContext(), DonutConsumer.class
-                            .getName(), m_topicsConsumersInstances[i]
-                            .getInstanceName());
-            m_topicsConsumers[i] = (DonutConsumer) getContext()
-                    .getService(m_topicsConsumersServices[i]);
-            topics.remove("donut-subscriber");
-        }
-
-        m_fooProvider = m_topicsProviders[0];
-        m_barProvider = m_topicsProviders[1];
-        m_nutProvider = m_topicsProviders[2];
-        m_fooBarProvider = m_topicsProviders[3];
-        m_barNutProvider = m_topicsProviders[4];
-        m_fooNutProvider = m_topicsProviders[5];
-        m_fooBarNutProvider = m_topicsProviders[6];
-        m_fooConsumer = m_topicsConsumers[0];
-        m_barConsumer = m_topicsConsumers[1];
-        m_nutConsumer = m_topicsConsumers[2];
-        m_fooBarConsumer = m_topicsConsumers[3];
-        m_barNutConsumer = m_topicsConsumers[4];
-        m_fooNutConsumer = m_topicsConsumers[5];
-        m_fooBarNutConsumer = m_topicsConsumers[6];
-
-    }
-
-    /**
-     * Creates a subscriber listening on a pattern topic (ending with '*').
-     * @throws ConfigurationException something bad happened.
-     * @throws MissingHandlerException something bad happened.
-     * @throws UnacceptableConfiguration something bad happened.
-     */
-    public void testSubscriberWithPatternTopic() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-    	Dictionary properties = new Hashtable();
-    	Dictionary topics = new Hashtable();
-
-        // Create the donut consumer instance, listening on a pattern topic
-        properties.put("instance.name","subscriber with pattern topic");
-        topics.put("donut-subscriber", "a/pattern/topic/*");
-        properties.put("event.topics", topics);
-
-        ComponentInstance instance = m_utils.getDonutConsumerFactory()
-                .createComponentInstance(properties);
-        instance.dispose();
-    }
-
-    /**
-     * Test the event handler reliability by sending events with all kinds of
-     * publisher and check they are received by all kinds of subscriber.
-     */
-    public void testReliability() {
-
-        // Flush donut list for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            m_consumers[i].clearDonuts();
-        }
-
-        // Send a lot of donut with each provider
-        List sentDonuts = new ArrayList(NUMBER_OF_PROVIDERS
-                * EahTestUtils.NUMBER_OF_TESTS);
-        for (int i = 0; i < NUMBER_OF_PROVIDERS; i++) {
-            for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-                sentDonuts.add(m_providers[i].sellDonut());
-            }
-        }
-
-        // Wait a respectable amount of time
-        EahTestUtils.sleep(EahTestUtils.BLACK_LIST_TIME
-                + EahTestUtils.A_LONG_TIME);
-
-        // Collect all received donuts for each consumer
-        for (int i = 0; i < NUMBER_OF_CONSUMERS; i++) {
-            List receivedDonuts = Arrays.asList(m_consumers[i].getAllDonuts());
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts.",
-                    sentDonuts.size(), receivedDonuts.size());
-            assertTrue("The receiver must have eaten all sent donuts.",
-                    receivedDonuts.containsAll(sentDonuts));
-        }
-    }
-
-    /**
-     * Test the synchronism of event sending for the component.
-     *
-     * This test consists to send synchronously a big amount of donuts and to
-     * check immediately if it has been received (by all quick consumers).
-     */
-    public void testSynchronism() {
-
-        // Flush donut list for quick consumers
-        for (int i = 0; i < NUMBER_OF_QUICK_CONSUMERS; i++) {
-            m_quickConsumers[i].clearDonuts();
-        }
-
-        // Send a lot of donuts and check they are immediately received.
-        Donut sentDonut;
-        Donut receivedDonut;
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            for (int j = 0; j < NUMBER_OF_SYNCHRONOUS_PROVIDERS; j++) {
-                sentDonut = m_synchronousProviders[j].sellDonut();
-                for (int k = 0; k < NUMBER_OF_QUICK_CONSUMERS; k++) {
-                    receivedDonut = m_quickConsumers[k].getDonut();
-                    assertEquals(
-                            "The donut must have been received immediately and be the be the same as the sent one.",
-                            sentDonut, receivedDonut);
-                }
-            }
-        }
-    }
-
-    /**
-     * Test that the received events contains the instance name of the sender.
-     */
-    public void testInstanceName() {
-
-        // Flush event list of the event tracker
-        m_eventTracker.clearEvents();
-
-        // Check that the publishes handler is here
-        HandlerFactory[] handlers = IPojoTestUtils.getHandlerFactories(context);
-        for (int i = 0; i < handlers.length; i++) {
-            String name = handlers[i].getHandlerName();
-            if ("composite".equals(handlers[i].getType())) {
-                name = name + " [composite]";
-            }
-            if (handlers[i].getMissingHandlers().size() == 0) {
-                System.out.println("Handler " + name + " (VALID)");
-            } else {
-            	System.out.println("Handler " + name + " (INVALID : " + handlers[i].getMissingHandlers() + ")");
-            }
-        }
-
-        Factory factory = IPojoTestUtils.getFactoryByName(context, "donut-provider-publishes");
-        assertNotNull(factory);
-        System.out.println(factory.getDescription());
-
-        // Send donuts and check the sender instance name
-        Event receivedEvent;
-        for (int i = 0; i < NUMBER_OF_EAH_PROVIDERS; i++) {
-            m_eahProviders[i].sellDonut();
-            receivedEvent = m_eventTracker.waitForEvent();
-            assertEquals(
-                    "The instance name property of the received message must be the same as the sender instance name.",
-                    m_eahProvidersInstances[i].getInstanceName(), receivedEvent
-                            .getProperty("publisher.instance.name"));
-        }
-    }
-
-    /**
-     * Test the event filtering.
-     *
-     * This test send donuts with different flavours. Each filtered consumer
-     * must receive only a certain kind of donut. Of course, all donuts must
-     * have been received too.
-     */
-    public void testFilters() {
-
-        // The sent donuts, sorted by flavour
-        List[] sentDonuts = new List[Donut.FLAVOURS.length];
-
-        // Flush donut list for each filtered consumer
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            m_filteredConsumers[i].clearDonuts();
-            sentDonuts[i] = new ArrayList(EahTestUtils.NUMBER_OF_TESTS
-                    / Donut.FLAVOURS.length);
-        }
-
-        // Send donuts
-        for (int j = 0; j < EahTestUtils.NUMBER_OF_TESTS; j++) {
-            Donut donut = m_synchronousDonutEventProvider.sellDonut();
-            sentDonuts[EahTestUtils.flavourIndex(donut.getFlavour())]
-                    .add(donut);
-        }
-
-        // Check the received donuts
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            Donut[] receivedDonuts = m_filteredConsumers[i].getAllDonuts();
-            assertEquals(
-                    "The number of received donuts must be the same as the number of sent donuts with the matching flavour.",
-                    sentDonuts[i].size(), receivedDonuts.length);
-            assertTrue(
-                    "The receiver must have eaten all sent donuts matching the wanted flavour.",
-                    Arrays.asList(receivedDonuts).containsAll(sentDonuts[i]));
-        }
-
-    }
-
-    /**
-     * Test the event topic.
-     *
-     * This test send donuts on several topics. Each consumer (who listens to
-     * one or several topics) must receive donuts sent on his specifics topics.
-     */
-    public void testTopics() {
-
-        // The sent donuts, sorted by topic
-        int foos = 0;
-        int bars = 0;
-        int nuts = 0;
-
-        // Flush consumers
-        m_fooConsumer.clearDonuts();
-        m_barConsumer.clearDonuts();
-        m_nutConsumer.clearDonuts();
-        m_fooBarConsumer.clearDonuts();
-        m_barNutConsumer.clearDonuts();
-        m_fooNutConsumer.clearDonuts();
-        m_fooBarNutConsumer.clearDonuts();
-
-        // Send donuts
-        for (int i = 0; i < EahTestUtils.NUMBER_OF_TESTS; i++) {
-            m_fooProvider.sellDonut();
-            foos++;
-
-            m_barProvider.sellDonut();
-            bars++;
-
-            m_nutProvider.sellDonut();
-            nuts++;
-
-            m_fooBarProvider.sellDonut();
-            foos++;
-            bars++;
-
-            m_barNutProvider.sellDonut();
-            bars++;
-            nuts++;
-
-            m_fooNutProvider.sellDonut();
-            foos++;
-            nuts++;
-
-            m_fooBarNutProvider.sellDonut();
-            foos++;
-            bars++;
-            nuts++;
-        }
-
-        // Check received donuts
-        assertEquals("The number of received donuts must be correct.", foos,
-                m_fooConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars,
-                m_barConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", nuts,
-                m_nutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars, m_fooBarConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", bars
-                + nuts, m_barNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + nuts, m_fooNutConsumer.getAllDonuts().length);
-        assertEquals("The number of received donuts must be correct.", foos
-                + bars + nuts, m_fooBarNutConsumer.getAllDonuts().length);
-
-    }
-
-    /**
-     * Finalization after test cases.
-     *
-     * Release all services references and destroy instances.
-     */
-    public void tearDown() {
-        int index;
-        for (index = 0; index < NUMBER_OF_PROVIDERS; index++) {
-            getContext().ungetService(m_providersServices[index]);
-            m_providersInstances[index].dispose();
-        }
-        for (index = 0; index < NUMBER_OF_CONSUMERS; index++) {
-            getContext().ungetService(m_consumersServices[index]);
-            m_consumersInstances[index].dispose();
-        }
-        getContext().ungetService(m_eventTrackerService);
-        m_eventTrackerInstance.dispose();
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            getContext().ungetService(m_filteredConsumersServices[i]);
-            m_filteredConsumersInstances[i].dispose();
-        }
-        for (int i = 0; i < TOPICS_LIST.length; i++) {
-            getContext().ungetService(m_topicsProvidersServices[i]);
-            m_topicsProvidersInstances[i].dispose();
-            getContext().ungetService(m_topicsConsumersServices[i]);
-            m_topicsConsumersInstances[i].dispose();
-        }
-
-    }
-
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/AsyncEventProviderImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/AsyncEventProviderImpl.java
deleted file mode 100644
index 6b0da14..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/AsyncEventProviderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Random;
-
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventAdmin;
-
-/**
- * Implementation of an event vendor that directly uses the Event Admin service
- * to post (asynchronously) raw events.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
- */
-public class AsyncEventProviderImpl implements DonutProvider {
-
-    /**
-     * The donut current serial number.
-     */
-    private long m_serial = 0L;
-
-    /**
-     * The name of the donut vendor.
-     */
-    private String m_name;
-
-    /**
-     * A random generator.
-     */
-    private Random m_random;
-
-    /**
-     * The Event Admin service reference.
-     */
-    private EventAdmin m_ea;
-
-    /**
-     * Construct a new donut provider. The initial serial number is randomly
-     * generated.
-     */
-    public AsyncEventProviderImpl() {
-        m_random = new Random(System.currentTimeMillis());
-    }
-
-    /**
-     * Sell a donut with a random flavour.
-     * 
-     * @return the sold donut
-     */
-    public Donut sellDonut() {
-        Dictionary rawEvent = new Hashtable();
-        Donut donut = new Donut(m_serial++, m_name, Donut.FLAVOURS[m_random
-                .nextInt(Donut.FLAVOURS.length)]);
-        rawEvent.put("food", donut);
-        m_ea.postEvent(new Event("food/donuts", rawEvent));
-        if (EahTestUtils.TRACE) {
-            System.err.println("[" + this.getClass().getSimpleName() + ":"
-                    + m_name + "] Selling donut " + donut);
-        }
-        return donut;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/Donut.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/Donut.java
deleted file mode 100644
index c7b4fc5..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/Donut.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-/**
- * Donut representation.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class Donut {
-
-    /**
-     * All possible donut flavours.
-     */
-    public static final String[] FLAVOURS = { "unflavoured", "icing sugar",
-        "chocolate", "toffee", "strawberry", "apple" };
-
-    /**
-     * The vendor's unique donut identifier.
-     */
-    private final long m_id;
-
-    /**
-     * The name of this donut's vendor.
-     */
-    private final String m_vendorName;
-
-    /**
-     * The m_flavour of this donut.
-     */
-    private final String m_flavour;
-
-    /**
-     * Create a new donut.
-     * 
-     * @param id
-     *            the vendor's unique donut identifier
-     * @param vendorName
-     *            the name of this donut's vendor
-     * @param flavour
-     *            the m_flavour of this donut
-     */
-    public Donut(long id, String vendorName, String flavour) {
-        this.m_id = id;
-        this.m_vendorName = vendorName;
-        this.m_flavour = flavour;
-    }
-
-    /**
-     * Get the vendor's unique identifier of this donut.
-     * 
-     * @return the id
-     */
-    public long getId() {
-        return m_id;
-    }
-
-    /**
-     * Get the vendor name of this donut.
-     * 
-     * @return the name
-     */
-    public String getVendorName() {
-        return m_vendorName;
-    }
-
-    /**
-     * Get the flavour of this donut.
-     * 
-     * @return the flavour
-     */
-    public String getFlavour() {
-        return m_flavour;
-    }
-
-    /**
-     * Return the string representation of this donut.
-     * 
-     * @return this donut as a String
-     */
-    public String toString() {
-        return m_id + " " + m_flavour + " (" + m_vendorName + ")";
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumer.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumer.java
deleted file mode 100644
index 0e5c483..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumer.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import org.osgi.service.event.Event;
-
-/**
- * Specification of a donut consumer.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public interface DonutConsumer {
-
-    /**
-     * Donut receiver callback. This method is called when a donut is received
-     * on the listened topic.
-     * 
-     * @param donut
-     *            the received donut
-     */
-    void receiveDonut(Donut donut);
-
-    /**
-     * Event donut receiver callback. This method is called when an event is
-     * received on the listened topic.
-     * 
-     * @param event
-     *            the received event
-     */
-    void receiveEvent(Event event);
-
-    /**
-     * Clear the eaten donuts list. (Useful before tests)
-     */
-    void clearDonuts();
-
-    /**
-     * Get the first received donut and remove it from the eaten donut list.
-     * 
-     * @return the first received donut or null if no donut is available
-     */
-    Donut getDonut();
-
-    /**
-     * Get the whole list of eaten donuts.
-     * 
-     * @return the array containing all eaten donuts
-     */
-    Donut[] getAllDonuts();
-
-    /**
-     * Get the first donut if available or wait for an incoming donut. The
-     * returned donut is removed from the eaten donut list.
-     * 
-     * @return the first available donut.
-     */
-    Donut waitForDonut();
-
-    /**
-     * Return the size of the eaten donut list.
-     * 
-     * @return the size of the eaten donut list
-     */
-    int getNumberOfDonuts();
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumerImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumerImpl.java
deleted file mode 100644
index 664290f..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutConsumerImpl.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.osgi.service.event.Event;
-
-/**
- * Implementation of a donut consumer.
- * 
- * @see Homer Simpson
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class DonutConsumerImpl implements DonutConsumer {
-
-    /**
-     * The name of the donut consumer.
-     */
-    private String m_name;
-
-    /**
-     * The list of eaten donuts.
-     */
-    private List m_donuts = new ArrayList();
-
-    /**
-     * Is this consumer a slow eater ?
-     */
-    private boolean m_isSlow;
-
-    /**
-     * Process incoming donuts. This method is called by the receiveDonut
-     * callback.
-     * 
-     * @param donut
-     *            the received donut
-     */
-    private void doReceiveDonut(Donut donut) {
-        synchronized (m_donuts) {
-            m_donuts.add(donut);
-            m_donuts.notify();
-            if (EahTestUtils.TRACE) {
-                System.err.println("[" + this.getClass().getSimpleName() + ":"
-                        + m_name + "] Eating donut " + donut);
-            }
-        }
-    }
-
-    /**
-     * Utility method that causes the current thread to sleep.
-     * 
-     * @param millis
-     *            the number of milliseconds to wait
-     */
-    public static void sleep(long millis) {
-        long past = System.currentTimeMillis();
-        long future = past + millis;
-        long now = past;
-        while (now < future) {
-            try {
-                Thread.sleep(future - now);
-            } catch (Exception e) {
-            }
-            now = System.currentTimeMillis();
-        }
-    }
-
-    /**
-     * Donut receiver callback. This method is called when a donut is received
-     * on the listened topic.
-     * 
-     * @param donut
-     *            the received donut
-     */
-    public void receiveDonut(Donut donut) {
-        final Donut myDonut = donut;
-        if (m_isSlow) {
-            new Thread(new Runnable() {
-                public void run() {
-                    sleep(EahTestUtils.BLACK_LIST_TIME);
-                    doReceiveDonut(myDonut);
-                }
-            }, m_name + " eating " + donut).start();
-        } else {
-            doReceiveDonut(donut);
-        }
-    }
-
-    /**
-     * Event donut receiver callback. This method is called when an event is
-     * received on the listened topic.
-     * 
-     * @param event
-     *            the received event
-     */
-    public void receiveEvent(Event event) {
-        Object thing = event.getProperty("food");
-        if (Donut.class.isInstance(thing)) {
-            receiveDonut((Donut) thing);
-        } else {
-            if (EahTestUtils.TRACE) {
-                System.err.println("[" + this.getClass().getSimpleName() + ":"
-                        + m_name + "] D'oh ! Received an uneatable thing : "
-                        + thing);
-                throw new ClassCastException("I want DONUTS !");
-            }
-        }
-    }
-
-    /**
-     * Clear the eaten donuts list. (Useful before tests)
-     */
-    public void clearDonuts() {
-        synchronized (m_donuts) {
-            m_donuts.clear();
-        }
-    }
-
-    /**
-     * Get the first received donut and remove it from the eaten donut list.
-     * 
-     * @return the first received donut or null if no donut is available
-     */
-    public Donut getDonut() {
-        Donut donut = null;
-        synchronized (m_donuts) {
-            if (!m_donuts.isEmpty()) {
-                donut = (Donut) m_donuts.remove(0);
-            }
-        }
-        return donut;
-    }
-
-    /**
-     * Get the whole list of eaten donuts.
-     * 
-     * @return the array containing all eaten donuts
-     */
-    public Donut[] getAllDonuts() {
-        Donut[] donuts = new Donut[0];
-        synchronized (m_donuts) {
-            donuts = (Donut[]) m_donuts.toArray(donuts);
-            m_donuts.clear();
-        }
-        return donuts;
-    }
-
-    /**
-     * Get the first donut if available or wait for an incoming donut. The
-     * returned donut is removed from the eaten donut list.
-     * 
-     * @return the first available donut.
-     */
-    public Donut waitForDonut() {
-        Donut donut = null;
-        synchronized (m_donuts) {
-            while (donut == null) {
-                if (m_donuts.isEmpty()) {
-                    try {
-                        m_donuts.wait();
-                    } catch (InterruptedException e) {
-                        // Thanks Checkstyle to forbid empty catch statements
-                        // ;-(
-                    }
-                } else {
-                    donut = (Donut) m_donuts.remove(0);
-                }
-            }
-        }
-        return donut;
-    }
-
-    /**
-     * Return the size of the eaten donut list.
-     * 
-     * @return the size of the eaten donut list
-     */
-    public int getNumberOfDonuts() {
-        int length;
-        synchronized (m_donuts) {
-            length = m_donuts.size();
-        }
-        return length;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutEventProviderImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutEventProviderImpl.java
deleted file mode 100644
index 154eff4..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutEventProviderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Random;
-
-import org.apache.felix.ipojo.handlers.event.publisher.Publisher;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-
-/**
- * Implementation of a donut vendor that send raw events instead of sending
- * Donut objects.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
- */
-public class DonutEventProviderImpl implements DonutProvider {
-
-    /**
-     * The donut current serial number.
-     */
-    private long m_serial = 0L;
-
-    /**
-     * The name of the donut vendor.
-     */
-    private String m_name;
-
-    /**
-     * A random generator.
-     */
-    private Random m_random;
-
-    /**
-     * The event publisher of the donut vendor.
-     */
-    private Publisher m_publisher;
-
-    /**
-     * Construct a new donut provider. The initial serial number is randomly
-     * generated.
-     */
-    public DonutEventProviderImpl() {
-        m_random = new Random(System.currentTimeMillis());
-    }
-
-    /**
-     * Sell a donut with a random flavour.
-     * 
-     * @return the sold donut
-     */
-    public Donut sellDonut() {
-        Dictionary rawEvent = new Hashtable();
-        String flavour = Donut.FLAVOURS[m_random.nextInt(Donut.FLAVOURS.length)];
-        Donut donut = new Donut(m_serial++, m_name, flavour);
-        rawEvent.put("food", donut);
-        rawEvent.put("flavour", flavour);
-        m_publisher.send(rawEvent);
-        if (EahTestUtils.TRACE) {
-            System.err.println("[" + this.getClass().getSimpleName() + ":"
-                    + m_name + "] Selling event donut " + donut);
-        }
-        return donut;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProvider.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProvider.java
deleted file mode 100644
index 17a1b92..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProvider.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-/**
- * Specification of a donut vendor.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
- */
-public interface DonutProvider {
-
-    /**
-     * Sell a donut with a random flavour.
-     * 
-     * @return the sold donut
-     */
-    Donut sellDonut();
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProviderImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProviderImpl.java
deleted file mode 100644
index 961eb1e..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/DonutProviderImpl.java
+++ /dev/null
@@ -1,79 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.Random;
-
-import org.apache.felix.ipojo.handlers.event.publisher.Publisher;
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-
-/**
- * The standard implementation of a donut vendor.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
- */
-public class DonutProviderImpl implements DonutProvider {
-
-    
-
-    /**
-     * The donut current serial number.
-     */
-    private long m_serial = 0L;
-
-    /**
-     * The name of the donut vendor.
-     */
-    private String m_name;
-
-    /**
-     * A random generator.
-     */
-    private Random m_random;
-
-    /**
-     * The donut publisher of the vendor.
-     */
-    private Publisher m_publisher;
-
-    /**
-     * Construct a new donut provider. The initial serial number is randomly
-     * generated.
-     */
-    public DonutProviderImpl() {
-        m_random = new Random(System.currentTimeMillis());
-    }
-
-    /**
-     * Sell a donut with a random flavour.
-     * 
-     * @return the sold donut
-     */
-    public Donut sellDonut() {
-        Donut donut = new Donut(m_serial++, m_name, Donut.FLAVOURS[m_random
-                .nextInt(Donut.FLAVOURS.length)]);
-        m_publisher.sendData(donut);
-        if (EahTestUtils.TRACE) {
-            System.err.println("[" + this.getClass().getSimpleName() + ":"
-                    + m_name + "] Selling donut " + donut);
-        }
-        return donut;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventConsumerImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventConsumerImpl.java
deleted file mode 100644
index 78b6f9f..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventConsumerImpl.java
+++ /dev/null
@@ -1,217 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/**
- * Implementation of a donut consumer.
- * 
- * @see Homer Simpson
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class EventConsumerImpl implements DonutConsumer, EventHandler {
-
-    /**
-     * The name of the donut consumer.
-     */
-    private String m_name;
-
-    /**
-     * The list of eaten donuts.
-     */
-    private List m_donuts = new ArrayList();
-
-    /**
-     * Is this consumer a slow eater ?
-     */
-    private boolean m_isSlow;
-
-    /**
-     * Process incoming donuts. This method is called by the receiveDonut
-     * callback.
-     * 
-     * @param donut
-     *            the received donut
-     */
-    private void doReceiveDonut(Donut donut) {
-        synchronized (m_donuts) {
-            m_donuts.add(donut);
-            m_donuts.notify();
-            if (EahTestUtils.TRACE) {
-                System.err.println("[" + this.getClass().getSimpleName() + ":"
-                        + m_name + "] Eating donut " + donut);
-            }
-        }
-    }
-
-    /**
-     * Utility method that causes the current thread to sleep.
-     * 
-     * @param millis
-     *            the number of milliseconds to wait
-     */
-    public static void sleep(long millis) {
-        long past = System.currentTimeMillis();
-        long future = past + millis;
-        long now = past;
-        while (now < future) {
-            try {
-                Thread.sleep(future - now);
-            } catch (Exception e) {
-            }
-            now = System.currentTimeMillis();
-        }
-    }
-
-    /**
-     * Donut receiver callback. This method is called when a donut is received
-     * on the listened topic.
-     * 
-     * @param donut
-     *            the received donut
-     */
-    public void receiveDonut(Donut donut) {
-        final Donut myDonut = donut;
-        if (m_isSlow) {
-            new Thread(new Runnable() {
-                public void run() {
-                    sleep(EahTestUtils.BLACK_LIST_TIME);
-                    doReceiveDonut(myDonut);
-                }
-            }, m_name + " eating " + donut).start();
-        } else {
-            doReceiveDonut(donut);
-        }
-    }
-
-    /**
-     * Event donut receiver callback. This method is called when an event is
-     * received on the listened topic.
-     * 
-     * @param event
-     *            the received event
-     */
-    public void receiveEvent(Event event) {
-        Object thing = event.getProperty("food");
-        if (Donut.class.isInstance(thing)) {
-            receiveDonut((Donut) thing);
-        } else {
-            if (EahTestUtils.TRACE) {
-                System.err.println("[" + this.getClass().getSimpleName() + ":"
-                        + m_name + "] D'oh ! Received an uneatable thing : "
-                        + thing);
-                throw new ClassCastException("I want DONUTS !");
-            }
-        }
-    }
-
-    /**
-     * Event receiver callback. This method is called by the event admin service
-     * when a event is received.
-     * 
-     * @param event
-     *            the received event
-     */
-    public void handleEvent(Event event) {
-        receiveEvent(event);
-    }
-
-    /**
-     * Clear the eaten donuts list. (Useful before tests)
-     */
-    public void clearDonuts() {
-        synchronized (m_donuts) {
-            m_donuts.clear();
-        }
-    }
-
-    /**
-     * Get the first received donut and remove it from the eaten donut list.
-     * 
-     * @return the first received donut or null if no donut is available
-     */
-    public Donut getDonut() {
-        Donut donut = null;
-        synchronized (m_donuts) {
-            if (!m_donuts.isEmpty()) {
-                donut = (Donut) m_donuts.remove(0);
-            }
-        }
-        return donut;
-    }
-
-    /**
-     * Get the whole list of eaten donuts.
-     * 
-     * @return the array containing all eaten donuts
-     */
-    public Donut[] getAllDonuts() {
-        Donut[] donuts = new Donut[0];
-        synchronized (m_donuts) {
-            donuts = (Donut[]) m_donuts.toArray(donuts);
-            m_donuts.clear();
-        }
-        return donuts;
-    }
-
-    /**
-     * Get the first donut if available or wait for an incoming donut. The
-     * returned donut is removed from the eaten donut list.
-     * 
-     * @return the first available donut.
-     */
-    public Donut waitForDonut() {
-        Donut donut = null;
-        synchronized (m_donuts) {
-            while (donut == null) {
-                if (m_donuts.isEmpty()) {
-                    try {
-                        m_donuts.wait();
-                    } catch (InterruptedException e) {
-                        // Thanks Checkstyle to forbid empty catch statements
-                        // ;-(
-                    }
-                } else {
-                    donut = (Donut) m_donuts.remove(0);
-                }
-            }
-        }
-        return donut;
-    }
-
-    /**
-     * Return the size of the eaten donut list.
-     * 
-     * @return the size of the eaten donut list
-     */
-    public int getNumberOfDonuts() {
-        int length;
-        synchronized (m_donuts) {
-            length = m_donuts.size();
-        }
-        return length;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTracker.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTracker.java
deleted file mode 100644
index eaca6c5..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTracker.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import org.osgi.service.event.Event;
-
-/**
- * Specification of an event tracker.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public interface EventTracker {
-
-    /**
-     * Clear the received events list. (Useful before tests)
-     */
-    void clearEvents();
-
-    /**
-     * Get the first received event and remove it from the events list.
-     * 
-     * @return the first received event or null if no event is available
-     */
-    Event getEvent();
-
-    /**
-     * Get the whole list of received events.
-     * 
-     * @return the array containing all received events
-     */
-    Event[] getAllEvents();
-
-    /**
-     * Get the first event if available or wait for an incoming event. The
-     * returned event is removed from the eaten event list.
-     * 
-     * @return the first available event.
-     */
-    Event waitForEvent();
-
-    /**
-     * Return the size of the events list.
-     * 
-     * @return the size of the events list
-     */
-    int getNumberOfEvents();
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTrackerImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTrackerImpl.java
deleted file mode 100644
index cb46662..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/EventTrackerImpl.java
+++ /dev/null
@@ -1,159 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventHandler;
-
-/**
- * Implementation of an event tracker.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class EventTrackerImpl implements EventTracker, EventHandler {
-
-    /**
-     * The name of the event tracker.
-     */
-    private String m_name;
-
-    /**
-     * The list of received events
-     */
-    private List m_events = new ArrayList();
-
-    /**
-     * Event receiver callback. This method is called by the event admin service
-     * when a event is received.
-     * 
-     * @param event
-     *            the received event
-     */
-    public void handleEvent(Event event) {
-        synchronized (m_events) {
-            m_events.add(event);
-            m_events.notify();
-            if (EahTestUtils.TRACE) {
-                System.err.println("[" + this.getClass().getSimpleName() + ":"
-                        + m_name + "] Event received : " + event);
-            }
-        }
-    }
-
-    /**
-     * Clear the received events list. (Useful before tests)
-     */
-    public void clearEvents() {
-        synchronized (m_events) {
-            m_events.clear();
-        }
-    }
-
-    /**
-     * Get the first received event and remove it from the events list.
-     * 
-     * @return the first received event or null if no event is available
-     */
-    public Event getEvent() {
-        Event event = null;
-        synchronized (m_events) {
-            if (!m_events.isEmpty()) {
-                event = (Event) m_events.remove(0);
-            }
-        }
-        return event;
-    }
-
-    /**
-     * Get the whole list of received events.
-     * 
-     * @return the array containing all received events
-     */
-    public Event[] getAllEvents() {
-        Event[] events = new Event[0];
-        synchronized (m_events) {
-            events = (Event[]) m_events.toArray(events);
-            m_events.clear();
-        }
-        return events;
-    }
-
-    /**
-     * Get the first event if available or wait for an incoming event. The
-     * returned event is removed from the eaten event list.
-     * 
-     * @return the first available event.
-     */
-    public Event waitForEvent() {
-        Event event = null;
-        synchronized (m_events) {
-            while (event == null) {
-                if (m_events.isEmpty()) {
-                    try {
-                        m_events.wait();
-                    } catch (InterruptedException e) {
-                        // Thanks Checkstyle to forbid empty catch statements
-                        // ;-(
-                    }
-                } else {
-                    event = (Event) m_events.remove(0);
-                }
-            }
-        }
-        return event;
-    }
-
-    /**
-     * Return the size of the events list.
-     * 
-     * @return the size of the events list
-     */
-    public int getNumberOfEvents() {
-        int length;
-        synchronized (m_events) {
-            length = m_events.size();
-        }
-        return length;
-    }
-
-    /**
-     * Return the string representation of a given event.
-     * 
-     * @return the string representation of a given event
-     */
-    public static String eventToString(Event e) {
-        StringBuilder buf = new StringBuilder();
-        buf.append("[" + e.getTopic() + "] {");
-
-        String[] properties = e.getPropertyNames();
-        int n = properties.length - 1;
-        for (int i = 0; i <= n; i++) {
-            String name = properties[i];
-            buf.append(name + "=" + e.getProperty(name));
-            if (i != n)
-                buf.append(", ");
-        }
-        buf.append("}");
-        return buf.toString();
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/SyncEventProviderImpl.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/SyncEventProviderImpl.java
deleted file mode 100644
index b8bfc8b..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/donut/SyncEventProviderImpl.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.donut;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-import java.util.Random;
-
-import org.apache.felix.ipojo.test.util.EahTestUtils;
-import org.osgi.service.event.Event;
-import org.osgi.service.event.EventAdmin;
-
-/**
- * Implementation of an event vendor that directly uses the Event Admin service
- * to send (synchronously) raw events.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- * 
- */
-public class SyncEventProviderImpl implements DonutProvider {
-
-    /**
-     * The donut current serial number.
-     */
-    private long m_serial = 0L;
-
-    /**
-     * The name of the donut vendor.
-     */
-    private String m_name;
-
-    /**
-     * A random generator.
-     */
-    private Random m_random;
-
-    /**
-     * The Event Admin service reference.
-     */
-    private EventAdmin m_ea;
-
-    /**
-     * Construct a new donut provider. The initial serial number is randomly
-     * generated.
-     */
-    public SyncEventProviderImpl() {
-        m_random = new Random(System.currentTimeMillis());
-    }
-
-    /**
-     * Sell a donut with a random flavour.
-     * 
-     * @return the sold donut
-     */
-    public Donut sellDonut() {
-        Dictionary rawEvent = new Hashtable();
-        Donut donut = new Donut(m_serial++, m_name, Donut.FLAVOURS[m_random
-                .nextInt(Donut.FLAVOURS.length)]);
-        rawEvent.put("food", donut);
-        m_ea.sendEvent(new Event("food/donuts", rawEvent));
-        if (EahTestUtils.TRACE) {
-            System.err.println("[" + this.getClass().getSimpleName() + ":"
-                    + m_name + "] Selling donut " + donut);
-        }
-        return donut;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/EahTestUtils.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/EahTestUtils.java
deleted file mode 100644
index 7119584..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/EahTestUtils.java
+++ /dev/null
@@ -1,227 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.util;
-
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.test.donut.Donut;
-import org.osgi.framework.BundleContext;
-
-/**
- * Useful variables used for the tests of the Event Admin Handler.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class EahTestUtils {
-
-    /**
-     * Enable debug messages ?
-     */
-    public static final boolean TRACE = false;
-
-    /**
-     * The number of tests to execute.
-     */
-    public static final int NUMBER_OF_TESTS = 50;
-
-    /**
-     * The time that is normally necessary to cause a blacklist from the event
-     * admin service.
-     */
-    public static final long BLACK_LIST_TIME = 5000L;
-
-    /**
-     * The long amount of time.
-     */
-    public static final long A_LONG_TIME = 1000L;
-
-    /**
-     * The bundle context.
-     */
-    private BundleContext m_context;
-
-    /**
-     * Construct a new Event Admin Handler Tests utility instance.
-     *
-     * @param context
-     *            the bundle context
-     */
-    public EahTestUtils(BundleContext context) {
-        m_context = context;
-    }
-
-    /**
-     * Return the (asynchronous) donut provider factory.
-     *
-     * @return the (asynchronous) donut provider factory
-     */
-    public Factory getDonutProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "donut-provider");
-    }
-
-    /**
-     * Return the (asynchronous) donut provider using publishes factory.
-     *
-     * @return the (asynchronous) donut provider using publishes factory
-     */
-    public Factory getDonutProviderUsingPublishesFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "donut-provider-publishes");
-    }
-
-    /**
-     * Return the synchronous donut provider factory.
-     *
-     * @return the synchronous donut provider factory
-     */
-    public Factory getSynchronousDonutProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "synchronous-donut-provider");
-    }
-
-    /**
-     * Return the synchronous donut provider factory using
-     * dataKey
-     *
-     * @return the synchronous donut provider factory
-     */
-    public Factory getSynchronousDonutProvider2Factory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "synchronous-donut-provider-2");
-    }
-
-    /**
-     * Return the (asynchronous) donut event provider factory.
-     *
-     * @return the (asynchronous) donut event provider factory
-     */
-    public Factory getDonutEventProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "donut-event-provider");
-    }
-
-    /**
-     * Return the synchronous donut event provider factory.
-     *
-     * @return the synchronous donut event provider factory
-     */
-    public Factory getSynchronousDonutEventProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "synchronous-donut-event-provider");
-    }
-
-    /**
-     * Return the event provider factory.
-     *
-     * @return the event provider factory
-     */
-    public Factory getEventProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "event-provider");
-    }
-
-    /**
-     * Return the synchronous event provider factory.
-     *
-     * @return the synchronous event provider factory
-     */
-    public Factory getSynchronousEventProviderFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "synchronous-event-provider");
-    }
-
-    /**
-     * Return the donut consumer factory.
-     *
-     * @return the donut consumer factory
-     */
-    public Factory getDonutConsumerFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "donut-consumer");
-    }
-
-    /**
-     * Return the donut consumer factory using dataKey
-     * and dataType.
-     *
-     * @return the donut consumer factory
-     */
-    public Factory getDonutConsumer2Factory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "donut-consumer-2");
-    }
-
-    /**
-     * Return the donut event consumer factory.
-     *
-     * @return the donut event consumer factory
-     */
-    public Factory getDonutEventConsumerFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context,
-                "donut-event-consumer");
-    }
-
-    /**
-     * Return the event consumer factory.
-     *
-     * @return the event consumer factory
-     */
-    public Factory getEventConsumerFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "event-consumer");
-    }
-
-    /**
-     * Return the event tracker.
-     *
-     * @return the event consumer factory
-     */
-    public Factory getEventTrackerFactory() {
-        return IPojoTestUtils.getFactoryByName(m_context, "event-tracker");
-    }
-
-    /**
-     * Utility method that causes the current thread to sleep.
-     *
-     * @param millis
-     *            the number of milliseconds to wait
-     */
-    public static void sleep(long millis) {
-        long past = System.currentTimeMillis();
-        long future = past + millis;
-        long now = past;
-        if (TRACE) {
-            System.err.println("Sleeping for " + millis + "ms");
-        }
-        while (now < future) {
-            try {
-                Thread.sleep(future - now);
-            } catch (Exception e) {
-            }
-            now = System.currentTimeMillis();
-        }
-    }
-
-    /**
-     * Return the index of the given donut flavour in the flavour array.
-     *
-     * @return the index of the given flavour or -1 if not found
-     */
-    public static int flavourIndex(String flavour) {
-        for (int i = 0; i < Donut.FLAVOURS.length; i++) {
-            if (Donut.FLAVOURS[i].equals(flavour))
-                return i;
-        }
-        return -1;
-    }
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/IPojoTestUtils.java b/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/IPojoTestUtils.java
deleted file mode 100644
index cd4fdbb..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/java/org/apache/felix/ipojo/test/util/IPojoTestUtils.java
+++ /dev/null
@@ -1,325 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-/**
- * Useful iPOJO methods used for the tests of the Event Admin Handler.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class IPojoTestUtils {
-
-    public static ComponentInstance getComponentInstance(BundleContext bc,
-            String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName
-                    + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc,
-            String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            return null;
-        }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err
-                    .println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(
-            BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName
-                    + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(),
-                    "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (Factory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : "
-                    + e.getMessage());
-            return null;
-        }
-    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(),
-                    "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                return null;
-            }
-            return (Factory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : "
-                    + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc,
-            String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "("
-                    + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : "
-                    + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory[] getHandlerFactories(BundleContext bc) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(HandlerFactory.class.getName(), null);
-            if (refs == null) {
-                System.err.println("Cannot get the handler factories");
-                return null;
-            }
-            HandlerFactory[] factories = new HandlerFactory[refs.length];
-            for (int i = 0; i < factories.length; i++) {
-            	factories[i] = (HandlerFactory) bc.getService(refs[i]);
-            }
-            return factories;
-        } catch (InvalidSyntaxException e) {
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf,
-            String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf,
-            String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf,
-            String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf,
-            String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc,
-            String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName())
-                || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc,
-            String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName())
-                || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-}
diff --git a/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml b/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
deleted file mode 100644
index 7f443fd..0000000
--- a/ipojo/tests/handler/eventadmin/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,180 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:ev="org.apache.felix.ipojo.handlers.event">
-
-	<!-- The (asynchronous) donut provider -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutProviderImpl"
-		name="donut-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Donut publisher -->
-		<ev:publisher name="donut-publisher" field="m_publisher"
-			topics="food/donuts" data-key="food" synchronous="false"/>
-	</component>
-
-		<!-- The (asynchronous) donut provider using publishes -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutProviderImpl"
-		name="donut-provider-publishes">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Donut publisher -->
-		<ev:publishes name="donut-publisher" field="m_publisher"
-			topics="food/donuts" dataKey="food" synchronous="false"/>
-	</component>
-
-	<!-- The synchronous donut provider -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutProviderImpl"
-		name="synchronous-donut-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Donut publisher -->
-		<ev:publisher name="donut-publisher" field="m_publisher"
-			topics="food/donuts" data-key="food" synchronous="true"/>
-	</component>
-
-		<!-- The synchronous donut provider using dataKey -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutProviderImpl"
-		name="synchronous-donut-provider-2">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Donut publisher -->
-		<ev:publisher name="donut-publisher" field="m_publisher"
-			topics="food/donuts" dataKey="food" synchronous="true"/>
-	</component>
-
-	<!-- The (asynchronous) donut event provider -->
-	<component
-		classname="org.apache.felix.ipojo.test.donut.DonutEventProviderImpl"
-		name="donut-event-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Raw events publisher -->
-		<ev:publisher name="event-publisher" field="m_publisher"
-			topics="food/donuts" synchronous="false"/>
-	</component>
-
-	<!-- The synchronous donut event provider -->
-	<component
-		classname="org.apache.felix.ipojo.test.donut.DonutEventProviderImpl"
-		name="synchronous-donut-event-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Raw events publisher -->
-		<ev:publisher name="event-publisher" field="m_publisher"
-			topics="food/donuts" synchronous="true"/>
-	</component>
-
-	<!-- The (asynchronous) event provider -->
-	<component
-		classname="org.apache.felix.ipojo.test.donut.AsyncEventProviderImpl"
-		name="event-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Direcly interacts with the Event Admin service -->
-		<requires field="m_ea"/>
-	</component>
-
-	<!-- The synchronous event provider -->
-	<component
-		classname="org.apache.felix.ipojo.test.donut.SyncEventProviderImpl"
-		name="synchronous-event-provider">
-		<!-- Expose the donut provider service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutProvider">
-			<property name="name" field="m_name" value="Unknown donut vendor"/>
-		</provides>
-		<!-- Direcly interacts with the Event Admin service -->
-		<requires field="m_ea"/>
-	</component>
-
-	<!-- The donut consumer -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutConsumerImpl"
-		name="donut-consumer">
-		<!-- Expose the donut consumer service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutConsumer">
-			<property name="name" field="m_name" value="Unknown donut consumer"/>
-			<property name="slow" field="m_isSlow" value="false"/>
-		</provides>
-		<!-- Donut events subscriber -->
-		<ev:subscriber name="donut-subscriber" callback="receiveDonut"
-			topics="food/donuts" data-key="food"
-			data-type="org.apache.felix.ipojo.test.donut.Donut"/>
-	</component>
-
-		<!-- The donut consumer using dataKey and dataType -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutConsumerImpl"
-		name="donut-consumer-2">
-		<!-- Expose the donut consumer service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutConsumer">
-			<property name="name" field="m_name" value="Unknown donut consumer"/>
-			<property name="slow" field="m_isSlow" value="false"/>
-		</provides>
-		<!-- Donut events subscriber -->
-		<ev:subscriber name="donut-subscriber" callback="receiveDonut"
-			topics="food/donuts" dataKey="food"
-			dataType="org.apache.felix.ipojo.test.donut.Donut"/>
-	</component>
-
-
-	<!-- The donut event consumer -->
-	<component classname="org.apache.felix.ipojo.test.donut.DonutConsumerImpl"
-		name="donut-event-consumer">
-		<!-- Expose the donut consumer service -->
-		<provides specifications="org.apache.felix.ipojo.test.donut.DonutConsumer">
-			<property name="name" field="m_name" value="Unknown donut consumer"/>
-			<property name="slow" field="m_isSlow" value="false"/>
-		</provides>
-		<!-- Raw events subscriber -->
-		<ev:subscriber name="donut-event-subscriber" callback="receiveEvent"
-			topics="food/donuts"/>
-	</component>
-
-	<!-- The event consumer -->
-	<component classname="org.apache.felix.ipojo.test.donut.EventConsumerImpl"
-		name="event-consumer">
-		<!-- Expose the donut consumer service -->
-		<provides
-			specifications="{org.apache.felix.ipojo.test.donut.DonutConsumer,org.osgi.service.event.EventHandler}">
-			<property name="name" field="m_name" value="Unknown event consumer"/>
-			<property name="slow" field="m_isSlow" value="false"/>
-			<property name="event.topics" type="String" value="food/donuts"/>
-		</provides>
-	</component>
-
-	<!-- The event tracker -->
-	<component classname="org.apache.felix.ipojo.test.donut.EventTrackerImpl"
-		name="event-tracker">
-		<!-- Expose the donut consumer service -->
-		<provides
-			specifications="{org.apache.felix.ipojo.test.donut.EventTracker,org.osgi.service.event.EventHandler}">
-			<property name="name" field="m_name" value="Unknown event tracker"/>
-			<property name="event.topics" type="String" value="food/donuts"/>
-		</provides>
-	</component>
-
-
-	<!-- Example instances -->
-	<instance component="donut-provider" name="zeifhgbzre">
-		<property name="name" value="Zeifhgbzre donuts"/>
-	</instance>
-	<instance component="donut-consumer" name="zeifhgbzre simpson">
-		<property name="name" value="Zeifhgbzre simpson"/>
-		<property name="slow" value="false"/>
-	</instance>
-
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/jmx/pom.xml b/ipojo/tests/handler/jmx/pom.xml
deleted file mode 100644
index 51d9697..0000000
--- a/ipojo/tests/handler/jmx/pom.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-    Licensed to the Apache Software Foundation (ASF) under one
-    or more contributor license agreements.  See the NOTICE file
-    distributed with this work for additional information
-    regarding copyright ownership.  The ASF licenses this file
-    to you under the Apache License, Version 2.0 (the
-    "License"); you may not use this file except in compliance
-    with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
-    Unless required by applicable law or agreed to in writing,
-    software distributed under the License is distributed on an
-    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-    KIND, either express or implied.  See the License for the
-    specific language governing permissions and limitations
-    under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>ipojo.tests</groupId>
-        <artifactId>ipojo.tests</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <groupId>ipojo.tests</groupId>
-    <version>1.5.0-SNAPSHOT</version>
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>bundle</packaging>
-    <name>iPOJO JMX Handler Test Suite</name>
-    <artifactId>tests.jmx.handler</artifactId>
-
-  <dependencies>
-        <dependency>
-          <groupId>org.apache.felix</groupId>
-          <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-        </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.handler.jmx</artifactId>
-      <version>1.5.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-    </dependency>
-  </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Private-Package>org.apache.felix.ipojo.test.*
-                            </Private-Package>
-                        <Test-Suite>
-                            org.apache.felix.ipojo.test.JmxTestSuite
-                        </Test-Suite>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-ipojo-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>ipojo-bundle</goal>
-                        </goals>
-                        <configuration>
-                            <ignoreAnnotations>false</ignoreAnnotations>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>maven-junit4osgi-plugin
-            </artifactId>
-            <version>1.1.0-SNAPSHOT</version>
-            <executions>
-              <execution>
-                <goals>
-                  <goal>test</goal>
-                </goals>
-                <configuration>
-                  <hideOutputs>false</hideOutputs>
-                  <logService>false</logService>
-                  <configuration>
-                  <org.osgi.http.port>8083</org.osgi.http.port>
-                  </configuration>
-                </configuration>
-              </execution>
-            </executions>
-         </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/JmxTestSuite.java b/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/JmxTestSuite.java
deleted file mode 100644
index 51ba0fb..0000000
--- a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/JmxTestSuite.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-/**
- * Event Admin Handler test suite.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class JmxTestSuite {
-
-    /**
-     * Generate the Event Admin Handler test suite.
-     *
-     * @param bc
-     *            the OSGi bundle context
-     * @return the Event Admin Handler test suite.
-     */
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("JMX Handler test suite",
-                bc);
-        ots.addTestSuite(MBeanTests.class);
-        return ots;
-    }
-
-}
\ No newline at end of file
diff --git a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/MBeanTests.java b/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/MBeanTests.java
deleted file mode 100644
index f1a91ee..0000000
--- a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/MBeanTests.java
+++ /dev/null
@@ -1,234 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test;
-
-import java.lang.management.ManagementFactory;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.IntrospectionException;
-import javax.management.ListenerNotFoundException;
-import javax.management.MBeanAttributeInfo;
-import javax.management.MBeanException;
-import javax.management.MBeanInfo;
-import javax.management.MBeanOperationInfo;
-import javax.management.MBeanParameterInfo;
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.Notification;
-import javax.management.NotificationListener;
-import javax.management.ObjectInstance;
-import javax.management.ObjectName;
-import javax.management.ReflectionException;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-
-/**
- * Test the good behaviour of the EventAdminHandler.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class MBeanTests extends OSGiTestCase {
-
-    /**
-     * Helper used to create test components.
-     */
-    private IPOJOHelper m_helper;
-
-    /**
-     * The MBean server used to access exposed MBeans.
-     */
-    private MBeanServer m_server;
-
-    /**
-     * Initialize test.
-     */
-    public void setUp() {
-        m_helper = new IPOJOHelper(this);
-        m_server = ManagementFactory.getPlatformMBeanServer();
-    }
-
-    /**
-     * Clean test.
-     */
-    public void tearDown() {
-        m_helper.dispose();
-    }
-
-    /**
-     * Test the MBean exposed by the simple component, defined without
-     * annotations and with the brand new JMX handler syntax.
-     */
-    public void testMBeanWithoutAnnotations() throws MalformedObjectNameException, IntrospectionException, InstanceNotFoundException, ListenerNotFoundException, ReflectionException, MBeanException {
-        // Create an instance of the component
-        ComponentInstance componentInstance = m_helper
-                .createComponentInstance("org.apache.felix.ipojo.test.component.SimpleManagedComponent");
-        String instanceName = componentInstance.getInstanceName();
-        ObjectName objectName = new ObjectName(
-                "org.apache.felix.ipojo.test.component:type=org.apache.felix.ipojo.test.component.SimpleManagedComponent,instance="
-                        + instanceName);
-        doTest(objectName);
-    }
-
-    /**
-     * Test the MBean exposed by the simple component, defined without
-     * annotations and with the deprecated JMX handler syntax.
-     */
-    public void testMBeanWithoutAnnotationsDeprecated() throws MalformedObjectNameException, IntrospectionException, InstanceNotFoundException, ListenerNotFoundException, ReflectionException, MBeanException {
-        // Create an instance of the component
-        ComponentInstance componentInstance = m_helper
-                .createComponentInstance("org.apache.felix.ipojo.test.component.SimpleManagedComponentDeprecated");
-        String instanceName = componentInstance.getInstanceName();
-        ObjectName objectName = new ObjectName(
-                "org.apache.felix.ipojo.test.component:type=org.apache.felix.ipojo.test.component.SimpleManagedComponent,instance="
-                        + instanceName);
-        doTest(objectName);
-    }
-
-
-    /**
-     * Test the MBean exposed by the simple component, defined with
-     * annotations.
-     */
-    public void testMBeanWithAnnotations() throws MalformedObjectNameException, IntrospectionException,
-            InstanceNotFoundException, ListenerNotFoundException,
-            ReflectionException, MBeanException {
-        // Create an instance of the component
-        ComponentInstance componentInstance = m_helper
-                .createComponentInstance("org.apache.felix.ipojo.test.component.SimpleManagedComponentAnnotated");
-        String instanceName = componentInstance.getInstanceName();
-        ObjectName objectName = new ObjectName(
-                "org.apache.felix.ipojo.test.component:type=org.apache.felix.ipojo.test.component.SimpleManagedComponentAnnotated,instance="
-                        + instanceName);
-        doTest(objectName);
-    }
-
-    /**
-     * Test the MBean exposed by the simple component, defined with
-     * annotations.
-     */
-    public void testMBeanWithAnnotationsDeprecated() throws MalformedObjectNameException, IntrospectionException,
-            InstanceNotFoundException, ListenerNotFoundException,
-            ReflectionException, MBeanException {
-        // Create an instance of the component
-        ComponentInstance componentInstance = m_helper
-                .createComponentInstance("org.apache.felix.ipojo.test.component.SimpleManagedComponentAnnotatedDeprecated");
-        String instanceName = componentInstance.getInstanceName();
-        ObjectName objectName = new ObjectName(
-                "org.apache.felix.ipojo.test.component:type=org.apache.felix.ipojo.test.component.SimpleManagedComponentAnnotatedDeprecated,instance="
-                        + instanceName);
-        doTest(objectName);
-    }
-
-    /**
-     * Utility method used to test the MBean with the given objectName.
-     * @param objectName the objectName of the MBean to test.
-     */
-    private void doTest(ObjectName objectName) throws IntrospectionException, InstanceNotFoundException, ReflectionException, MBeanException, ListenerNotFoundException {
-
-        // Get the MBean from the platform MBean server
-
-        MBeanInfo mBeanInfo = m_server.getMBeanInfo(objectName);
-        ObjectInstance objectInstance = m_server.getObjectInstance(objectName);
-        assertNotNull(mBeanInfo);
-        assertNotNull(objectInstance);
-        // Check that the property is exposed
-        MBeanAttributeInfo[] attributes = mBeanInfo.getAttributes();
-        assertEquals(1, attributes.length);
-        MBeanAttributeInfo attribute = attributes[0];
-        assertEquals("integer", attribute.getName());
-        assertEquals("int", attribute.getType());
-        assertTrue(attribute.isReadable());
-        assertFalse(attribute.isWritable());
-        // Check that both methods are exposed
-        MBeanOperationInfo[] operations = mBeanInfo.getOperations();
-        assertEquals(2, operations.length);
-        MBeanOperationInfo getOperation;
-        MBeanOperationInfo setOperation;
-        // Order is not important
-        if (operations[0].getName().equals("getIntegerValue")) {
-            getOperation = operations[0];
-            setOperation = operations[1];
-        } else {
-            setOperation = operations[0];
-            getOperation = operations[1];
-        }
-        // Check the 'get' operation
-        assertEquals("getIntegerValue", getOperation.getName());
-        assertEquals("Get the value of the integer",
-                getOperation.getDescription());
-        assertEquals("int", getOperation.getReturnType());
-        MBeanParameterInfo[] getOperationParams = getOperation.getSignature();
-        assertEquals(0, getOperationParams.length);
-        // Check the 'set' operation
-        assertEquals("setIntegerValue", setOperation.getName());
-        assertEquals("Set the value of the integer",
-                setOperation.getDescription());
-        assertEquals("int", setOperation.getReturnType());
-        MBeanParameterInfo[] setOperationParams = setOperation.getSignature();
-        assertEquals(1, setOperationParams.length);
-        assertEquals("int", setOperationParams[0].getType());
-        // Call the methods and test the result, also test notifications
-        CustomNotificationListener listener = new CustomNotificationListener();
-        m_server.addNotificationListener(objectName, listener, null, null);
-        int value1 = 123;
-        int value2 = 456;
-        m_server.invoke(objectName, "setIntegerValue", new Object[] { value1 },
-                new String[] { "int" });
-        m_server.invoke(objectName, "setIntegerValue", new Object[] { value2 },
-                new String[] { "int" });
-        int result = (Integer) m_server.invoke(objectName, "getIntegerValue",
-                new Object[0], new String[0]);
-        assertEquals(value2, result);
-        m_server.removeNotificationListener(objectName, listener, null, null);
-        //assertEquals(2, listener.getCount());
-    }
-
-    /**
-     * Custom listener used to count MBean notifications.
-     * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
-     */
-    private class CustomNotificationListener implements NotificationListener {
-
-        /**
-         * Counter for the notifications.
-         */
-        private int m_counter = 0;
-
-        /**
-         * Notified !
-         * @param notification the notification
-         * @param handback ignored
-         */
-        public void handleNotification(Notification notification,
-                Object handback) {
-            m_counter++;
-        }
-
-        /**
-         * Return the notification count of this listener.
-         * @return the notification count of this listener.
-         */
-        public int getCount() {
-            return m_counter;
-        }
-    }
-
-}
diff --git a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponent.java b/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponent.java
deleted file mode 100644
index 2a22a9b..0000000
--- a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponent.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.component;
-
-import java.util.Random;
-
-/**
- * Simple component that holds an integer. It is exposed as a MBean.
- *
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-public class SimpleManagedComponent {
-
-    /**
-     * The integer.
-     */
-    private int m_integer /*= new Random().nextInt()*/;
-
-    /**
-     * Set the value of the integer.
-     * @param newValue the new value
-     * @return the old value of the integer.
-     */
-    @SuppressWarnings("unused")
-    private synchronized int setIntegerValue(int newValue) {
-        int oldValue = m_integer;
-        m_integer = newValue;
-        return oldValue;
-    }
-
-    /**
-     * Get the value of the integer.
-     * @return the currentvalue of the integer.
-     */
-    @SuppressWarnings("unused")
-    private synchronized int getIntegerValue() {
-        return m_integer;
-    }
-
-}
diff --git a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotated.java b/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotated.java
deleted file mode 100644
index 398948e..0000000
--- a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotated.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.component;
-
-import java.util.Random;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.jmx.JMXBean;
-import org.apache.felix.ipojo.handlers.jmx.JMXMethod;
-import org.apache.felix.ipojo.handlers.jmx.JMXProperty;
-
-/**
- * Simple component that holds an integer. It is exposed as a MBean. This
- * version uses the brand new annotations of the JMX handler.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-@Component(immediate = true)
-@JMXBean
-public class SimpleManagedComponentAnnotated {
-
-    /**
-     * The integer.
-     */
-    @JMXProperty(name = "integer", rights = "r", notification = true)
-    private int m_integer = new Random().nextInt();;
-
-    /**
-     * Set the value of the integer.
-     * 
-     * @param newValue
-     *            the new value
-     * @return the old value of the integer.
-     */
-    @SuppressWarnings("unused")
-    @JMXMethod(description = "Set the value of the integer")
-    private synchronized int setIntegerValue(int newValue) {
-        int oldValue = m_integer;
-        m_integer = newValue;
-        return oldValue;
-    }
-
-    /**
-     * Get the value of the integer.
-     * 
-     * @return the currentvalue of the integer.
-     */
-    @SuppressWarnings("unused")
-    @JMXMethod(description = "Get the value of the integer")
-    private synchronized int getIntegerValue() {
-        return m_integer;
-    }
-}
diff --git a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotatedDeprecated.java b/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotatedDeprecated.java
deleted file mode 100644
index 716514b..0000000
--- a/ipojo/tests/handler/jmx/src/main/java/org/apache/felix/ipojo/test/component/SimpleManagedComponentAnnotatedDeprecated.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.component;
-
-import java.util.Random;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.handlers.jmx.Config;
-import org.apache.felix.ipojo.handlers.jmx.Method;
-import org.apache.felix.ipojo.handlers.jmx.Property;
-
-
-/**
- * Simple component that holds an integer. It is exposed as a MBean. This
- * version uses the deprecated annotations of the JMX handler.
- * 
- * @author <a href="mailto:dev@felix.apache.org">Felix Project Team</a>
- */
-@Component(immediate = true)
-@Config
-public class SimpleManagedComponentAnnotatedDeprecated {
-
-    /**
-     * The integer.
-     */
-    @Property(name = "integer", rights = "r", notification = true)
-    private int m_integer = new Random().nextInt();;
-
-    /**
-     * Set the value of the integer.
-     * 
-     * @param newValue
-     *            the new value
-     * @return the old value of the integer.
-     */
-    @SuppressWarnings("unused")
-    @Method(description = "Set the value of the integer")
-    private synchronized int setIntegerValue(int newValue) {
-        int oldValue = m_integer;
-        m_integer = newValue;
-        return oldValue;
-    }
-
-    /**
-     * Get the value of the integer.
-     * 
-     * @return the currentvalue of the integer.
-     */
-    @SuppressWarnings("unused")
-    @Method(description = "Get the value of the integer")
-    private synchronized int getIntegerValue() {
-        return m_integer;
-    }
-}
diff --git a/ipojo/tests/handler/jmx/src/main/resources/metadata.xml b/ipojo/tests/handler/jmx/src/main/resources/metadata.xml
deleted file mode 100644
index cbc7b03..0000000
--- a/ipojo/tests/handler/jmx/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,27 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:jmx="org.apache.felix.ipojo.handlers.jmx">
-
-	<!-- The simple managed component without annotations and with brand new JMX handler syntax -->
-	<component classname="org.apache.felix.ipojo.test.component.SimpleManagedComponent" immediate="true">
-		<!-- Expose field and methods with JMX handler -->
-        <jmx:config>
-          <jmx:jmxmethod name="getIntegerValue" description="Get the value of the integer"/>
-          <jmx:jmxmethod name="setIntegerValue" description="Set the value of the integer"/>
-          <jmx:jmxproperty name="integer" field="m_integer" rights="r" notification="true"/>
-        </jmx:config>
-	</component>
-  
-  <!-- The simple managed component without annotations and with brand new JMX handler syntax -->
-  <component classname="org.apache.felix.ipojo.test.component.SimpleManagedComponent" immediate="true" name="org.apache.felix.ipojo.test.component.SimpleManagedComponentDeprecated">
-    <!-- Expose field and methods with JMX handler -->
-        <jmx:config>
-          <jmx:method name="getIntegerValue" description="Get the value of the integer"/>
-          <jmx:method name="setIntegerValue" description="Set the value of the integer"/>
-          <jmx:property name="integer" field="m_integer" rights="r" notification="true"/>
-        </jmx:config>
-  </component>
-
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/temporal/pom.xml b/ipojo/tests/handler/temporal/pom.xml
deleted file mode 100644
index f2e7559..0000000
--- a/ipojo/tests/handler/temporal/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Temporal Dependency Test Suite</name>
-  <artifactId>tests.temporal</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.temporal.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>org.apache.felix.ipojo.handler.temporal</artifactId>
-        <version>${project.version}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.temporal.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-            org.apache.felix.ipojo.test.scenarios.temporal.TemporalTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-
-
-        <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
deleted file mode 100644
index b654826..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CheckServiceProvider.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class CheckServiceProvider implements CheckService {
-    
-    /**
-     * Temporal dependency.
-     */
-    private FooService fs;
-
-    public boolean check() {
-        if (fs != null) {
-            return fs.foo();
-        }
-        return false;
-    }
-
-    public Properties getProps() {
-        if (fs != null) {
-            return fs.fooProps();
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckServiceProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckServiceProvider.java
deleted file mode 100644
index 03c5776..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CollectionCheckServiceProvider.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class CollectionCheckServiceProvider implements CheckService {
-    
-    /**
-     * Temporal dependency.
-     */
-    private Collection fs;
-
-    public boolean check() {
-        boolean result = true;
-        //Use a local variable to avoid to wait at each access.
-        Collection col = fs;
-        if (col  != null) {
-            Iterator it = col.iterator();
-            while (it.hasNext()) {
-                FooService svc =  (FooService) it.next();
-                result = result && svc.foo();
-            }
-        }        
-        return result;
-    }
-
-    public Properties getProps() {
-        Iterator it = fs.iterator();
-        if (it.hasNext()) {
-            FooService svc = (FooService) it.next();
-            return svc.fooProps();
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProvider.java
deleted file mode 100644
index 7bd5540..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class FooProvider implements FooService {
-
-    public boolean foo() {
-       return true;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return 0;
-    }
-
-    public int getInt() {
-        return 0;
-    }
-
-    public long getLong() {
-        return 0;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
deleted file mode 100644
index fb96538..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckServiceProvider.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class MultipleCheckServiceProvider implements CheckService {
-    
-    /**
-     * Temporal dependency.
-     */
-    private FooService[] fs;
-
-    public boolean check() {
-        boolean result = true;
-        //Use a local variable to avoid to wait at each access.
-        FooService[] array = fs;
-        for (int i = 0; array != null && i < array.length; i++) {
-            result = result && array[i].foo();
-            System.out.println("Result : " + result);
-        }
-        return result;
-    }
-
-    public Properties getProps() {
-        return fs[0].fooProps();
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java
deleted file mode 100644
index 821c8c8..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NullableFooProvider.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class NullableFooProvider implements FooService {
-
-    public boolean foo() {
-       return false;
-    }
-
-    public Properties fooProps() {
-        return null;
-    }
-
-    public boolean getBoolean() {
-        return false;
-    }
-
-    public double getDouble() {
-        return -1;
-    }
-
-    public int getInt() {
-        return -1;
-    }
-
-    public long getLong() {
-        return -1;
-    }
-
-    public Boolean getObject() {
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
deleted file mode 100755
index 0f1e8d3..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CheckServiceProviderHelper.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class CheckServiceProviderHelper implements CheckService {
-    
-    /**
-     * injected dependency.
-     */
-    private FooService fs;
-    
-    public CheckServiceProviderHelper(FooService svc) {
-        fs = svc;
-    }
-
-    public boolean check() {
-        if (fs != null) { // Cannot be null
-            try {
-                return fs.foo();
-            } catch (RuntimeException e) { // Now it's a runtime exception (FELIX-2472)
-                // Can throw a RTE for null policy and for time out
-                if (e.getMessage().equals("No service available")) {
-                    // Has detected a null policy.
-                    System.out.println(e.getMessage());
-                    return false;
-                } else {
-                    // Timeout
-                    // Propagate the exception
-                    throw e;
-                }
-            }
-        }
-        return false;
-    }
-
-    public Properties getProps() {
-        if (fs != null) {
-            return fs.fooProps();
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CollectionCheckServiceProviderHelper.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CollectionCheckServiceProviderHelper.java
deleted file mode 100644
index 9344722..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/CollectionCheckServiceProviderHelper.java
+++ /dev/null
@@ -1,62 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.proxy;
-
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class CollectionCheckServiceProviderHelper implements CheckService {
-    
-    /**
-     * Injected dependency.
-     */
-    private Collection fs;
-    
-    public CollectionCheckServiceProviderHelper(Collection col) {
-        fs = col;
-    }
-
-    public boolean check() {
-        boolean result = true;
-        //Use a local variable to avoid to wait at each access.
-        Collection col = fs;
-        if (col  != null) {
-            Iterator it = col.iterator(); // Get the cached copy
-            while (it != null && it.hasNext()) {
-                FooService svc =  (FooService) it.next();
-                result = result && svc.foo();
-            }
-        }        
-        return result;
-    }
-
-    public Properties getProps() {
-        Iterator it = fs.iterator();
-        if (it.hasNext()) {
-            FooService svc = (FooService) it.next();
-            return svc.fooProps();
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCheckServiceProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCheckServiceProvider.java
deleted file mode 100755
index f4b4099..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCheckServiceProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.proxy;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-
-public class HelpedCheckServiceProvider implements CheckService {
-    
-    /**
-     * Temporal dependency.
-     */
-    private FooService fs;
-    
-    private CheckServiceProviderHelper helper = new CheckServiceProviderHelper(fs);
-
-    public boolean check() {
-        return helper.check();
-    }
-
-    public Properties getProps() {
-        return helper.getProps();
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCollectionCheckServiceProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCollectionCheckServiceProvider.java
deleted file mode 100644
index f0c0e5d..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/component/proxy/HelpedCollectionCheckServiceProvider.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.proxy;
-
-import java.util.Collection;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-
-public class HelpedCollectionCheckServiceProvider implements CheckService {
-    
-    /**
-     * Temporal dependency.
-     */
-    private Collection fs;
-    
-    private CollectionCheckServiceProviderHelper helper = new CollectionCheckServiceProviderHelper(fs);
-
-    public boolean check() {
-        return helper.check();
-    }
-
-    public Properties getProps() {
-        return helper.getProps();
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
deleted file mode 100644
index bf3e7b0..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DefaultImplementationTest.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DefaultImplementationTest extends OSGiTestCase {
-    
-   public void testDefaultImplementation() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-      
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDefaultImplementationWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-      
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDefaultImplementationTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDefaultImplementationTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DICheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIProxiedCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDefaultImplementationMultipleTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDefaultImplementationCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDefaultImplementationProxiedCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-DIProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayOnMultipleDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained DI will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained DI will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnProxiedCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained DI will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java
deleted file mode 100644
index bbd6a5c..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayTest.java
+++ /dev/null
@@ -1,488 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class DelayTest extends OSGiTestCase {
-    
-   public void testDelay() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       assertNull("No FooService", Utils.getServiceReference(context, FooService.class.getName(), null));
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay (" + (end - begin) + ")", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-              
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-
-   public void testTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 4000);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }   
-       
-       fail("Timeout expected");
-   }
-   
-
-   public void testTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 4000);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }   
-       
-       fail("Timeout expected");
-   }
-
-
-   public void testDelayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-   public void testDelayTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-   public void testSetTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }   
-       
-       fail("Timeout expected");
-   }
-
-
-   public void testSetTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }   
-       
-       fail("Timeout expected");
-   }
-
-   public void testDelayOnMultipleDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-MultipleCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider1.stop();
-       provider2.stop();
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-
-   public void testDelayOnCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider1.stop();
-       provider2.stop();
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-
-   public void testDelayOnProxiedCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider1.stop();
-       provider2.stop();
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayedProvider.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayedProvider.java
deleted file mode 100644
index a5c508e..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/DelayedProvider.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-
-public class DelayedProvider implements Runnable {
-    
-    
-    public static final long DELAY = 1000;
-    ComponentInstance instance;
-    long delay = DELAY;
-    Thread thread;
-    
-    public DelayedProvider(ComponentInstance ci) {
-        instance =ci;
-    }
-    
-    public DelayedProvider(ComponentInstance ci, long time) {
-        instance =ci;
-        delay = time;
-    }    
-    
-    public void start() {
-        thread = new Thread(this);
-        thread.start();
-    }
-    
-    public void stop() {
-        if (thread != null) {
-            thread.interrupt();
-        }
-    }
-
-    public void run() {
-            System.out.println("Start sleeping for " + delay);
-            long begin = System.currentTimeMillis();
-            try {
-                Thread.sleep(delay);
-                long end = System.currentTimeMillis();
-                if (end - begin < delay) {
-                	// Wait for the remaining time
-                	Thread.sleep(delay - (end - begin));
-                }
-            } catch (InterruptedException e) {
-                System.out.println("Interrupted ...");
-                return;
-            }
-            System.out.println("Wakeup");
-            thread = null;
-            instance.start();
-            System.out.println(instance.getInstanceName() + " started");
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyTest.java
deleted file mode 100755
index 1ecf5bf..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/EmptyTest.java
+++ /dev/null
@@ -1,296 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class EmptyTest extends OSGiTestCase {
-   
-   public void testEmptyArrayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("An empty array was expected ...");
-       }   
-       assertTrue("Check empty array", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testEmptyCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("An empty array was expected ...");
-       }   
-       assertTrue("Check empty array", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testEmptyProxiedCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("An empty array was expected ...");
-       }   
-       assertTrue("Check empty array", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayOnMultipleDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyMultipleCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertTrue("Check invocation - 3", cs.check()); 
-       
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertTrue("Check invocation - 3", cs.check()); 
-       
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnProxiedCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-EmptyProxiedColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertTrue("Check invocation - 3", cs.check()); 
-       
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/FilterTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/FilterTest.java
deleted file mode 100644
index c8a0cd7..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/FilterTest.java
+++ /dev/null
@@ -1,256 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-import java.util.Dictionary;
-import java.util.Hashtable;
-
-/**
- * Checks <tt>requires.filter</tt>, <tt>temporal.filter</tt>, <tt>temporal.from</tt> and
- * <tt>requires.from</tt> attributes.
- */
-public class FilterTest extends OSGiTestCase {
-
-    /**
-     * Checks <tt>temporal.filter</tt> with dependency id.
-     * The filter is made to get only one provider.
-     */
-    public void testWithTemporalFilters() {
-        String prov = "provider";
-        ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-        String prov2 = "provider2";
-        ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-
-        Dictionary configuration = new Hashtable();
-        String un = "under-1";
-        configuration.put("instance.name", un);
-        Dictionary filter = new Hashtable();
-        filter.put("foo", "(instance.name=provider2)");
-        configuration.put("temporal.filters", filter);
-        ComponentInstance under = Utils.getComponentInstance(context, "TEMPORAL-MultipleCheckServiceProvider", configuration);
-
-        ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-        assertNotNull("Check foo availability", ref_fs);
-
-        ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability", ref_cs);
-
-        CheckService cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation", cs.check());
-
-        // Stop the provider.
-        provider2.stop();
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 2", ref_cs);
-        long begin = System.currentTimeMillis();
-        DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-        dp2.start();
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 2", cs.check());
-        long end = System.currentTimeMillis();
-        System.out.println("delay = " + (end - begin));
-        assertTrue("Assert min delay", (end - begin) >= 100);
-        assertTrue("Assert max delay", (end - begin) <= 1000);
-        dp2.stop();
-
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 3", ref_cs);
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 3", cs.check());
-
-        provider1.stop();
-        provider2.stop();
-        provider1.dispose();
-        provider2.dispose();
-        under.stop();
-        under.dispose();
-    }
-
-    /**
-     * Checks <tt>requires.filter</tt> with dependency id.
-     * The filter is made to get only one provider.
-     */
-    public void testWithRequireFilters() {
-        String prov = "provider";
-        ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-        String prov2 = "provider2";
-        ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-
-        Dictionary configuration = new Hashtable();
-        String un = "under-1";
-        configuration.put("instance.name", un);
-        Dictionary filter = new Hashtable();
-        filter.put("foo", "(instance.name=provider2)");
-        configuration.put("requires.filters", filter);
-        ComponentInstance under = Utils.getComponentInstance(context, "TEMPORAL-MultipleCheckServiceProvider", configuration);
-
-        ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-        assertNotNull("Check foo availability", ref_fs);
-
-        ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability", ref_cs);
-
-        CheckService cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation", cs.check());
-
-        // Stop the provider.
-        provider2.stop();
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 2", ref_cs);
-        long begin = System.currentTimeMillis();
-        DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-        dp2.start();
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 2", cs.check());
-        long end = System.currentTimeMillis();
-        System.out.println("delay = " + (end - begin));
-        assertTrue("Assert min delay", (end - begin) >= 100);
-        assertTrue("Assert max delay", (end - begin) <= 1000);
-        dp2.stop();
-
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 3", ref_cs);
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 3", cs.check());
-
-        provider1.stop();
-        provider2.stop();
-        provider1.dispose();
-        provider2.dispose();
-        under.stop();
-        under.dispose();
-    }
-
-    /**
-     * Checks <tt>temporal.from</tt> with dependency id.
-     * The filter is made to get only one specific provider.
-     */
-    public void testWithTemporalFrom() {
-        String prov = "provider";
-        ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-        String prov2 = "provider2";
-        ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-
-        Dictionary configuration = new Hashtable();
-        String un = "under-1";
-        configuration.put("instance.name", un);
-        Dictionary filter = new Hashtable();
-        filter.put("foo", "provider2");
-        configuration.put("temporal.from", filter);
-        ComponentInstance under = Utils.getComponentInstance(context, "TEMPORAL-MultipleCheckServiceProvider", configuration);
-
-        ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-        assertNotNull("Check foo availability", ref_fs);
-
-        ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability", ref_cs);
-
-        CheckService cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation", cs.check());
-
-        // Stop the provider.
-        provider2.stop();
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 2", ref_cs);
-        long begin = System.currentTimeMillis();
-        DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-        dp2.start();
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 2", cs.check());
-        long end = System.currentTimeMillis();
-        System.out.println("delay = " + (end - begin));
-        assertTrue("Assert min delay", (end - begin) >= 100);
-        assertTrue("Assert max delay", (end - begin) <= 1000);
-        dp2.stop();
-
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 3", ref_cs);
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 3", cs.check());
-
-        provider1.stop();
-        provider2.stop();
-        provider1.dispose();
-        provider2.dispose();
-        under.stop();
-        under.dispose();
-    }
-
-    /**
-     * Checks <tt>requires.from</tt> with dependency id.
-     * The filter is made to get only one specific provider.
-     */
-    public void testWithRequiresFrom() {
-        String prov = "provider";
-        ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-        String prov2 = "provider2";
-        ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-
-        Dictionary configuration = new Hashtable();
-        String un = "under-1";
-        configuration.put("instance.name", un);
-        Dictionary filter = new Hashtable();
-        filter.put("foo", "provider2");
-        configuration.put("requires.from", filter);
-        ComponentInstance under = Utils.getComponentInstance(context, "TEMPORAL-MultipleCheckServiceProvider", configuration);
-
-        ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-        assertNotNull("Check foo availability", ref_fs);
-
-        ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability", ref_cs);
-
-        CheckService cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation", cs.check());
-
-        // Stop the provider.
-        provider2.stop();
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 2", ref_cs);
-        long begin = System.currentTimeMillis();
-        DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-        dp2.start();
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 2", cs.check());
-        long end = System.currentTimeMillis();
-        System.out.println("delay = " + (end - begin));
-        assertTrue("Assert min delay", (end - begin) >= 100);
-        assertTrue("Assert max delay", (end - begin) <= 1000);
-        dp2.stop();
-
-        ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-        assertNotNull("Check cs availability - 3", ref_cs);
-        cs = (CheckService) context.getService(ref_cs);
-        assertTrue("Check invocation - 3", cs.check());
-
-        provider1.stop();
-        provider2.stop();
-        provider1.dispose();
-        provider2.dispose();
-        under.stop();
-        under.dispose();
-    }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NoDelayTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NoDelayTest.java
deleted file mode 100644
index 0e31841..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NoDelayTest.java
+++ /dev/null
@@ -1,139 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class NoDelayTest extends OSGiTestCase {
-    
-   public void testNoDelay() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProvider", un);
-       assertNotNull("Check creation", under);
-       assertNotNull("Check provider creation", prov);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNoDelayWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProvider", un);
-       assertNotNull("Check creation", under);
-       assertNotNull("Check provider creation", prov);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testMultipleNoDelay() {
-       String prov1 = "provider-1";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov1);
-       String un = "under-2";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-MultipleCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov1);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       provider1.stop();
-       provider1.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testCollectionNoDelay() {
-       String prov1 = "provider-1";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov1);
-       String un = "under-2";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov1);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       provider1.stop();
-       provider1.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testProxiedCollectionNoDelay() {
-       String prov1 = "provider-1";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov1);
-       String un = "under-2";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedColCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov1);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       provider1.stop();
-       provider1.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
deleted file mode 100644
index 81ad5b0..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullTest.java
+++ /dev/null
@@ -1,523 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class NullTest extends OSGiTestCase {
-    
-   public void testNull() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A null was expected ...");
-       }   
-       assertFalse("Check null", res); // Return false when the foo service is null.
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A null was expected ...");
-       }   
-       assertFalse("Check null", res); // Return false when the foo service is null.
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullProxiedCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullMultipleTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A null was expected ...");
-       }   
-       assertTrue("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testNullCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A null was expected ...");
-       }   
-       assertTrue("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testNullProxiedCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A null was expected ... : " + e.getMessage());
-           e.printStackTrace();
-       }   
-       assertTrue("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayOnMultipleDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnProxiedCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
deleted file mode 100644
index b4a4c04..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/NullableTest.java
+++ /dev/null
@@ -1,522 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class NullableTest extends OSGiTestCase {
-    
-   public void testNullable() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-      
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullableTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullableWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-      
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullableTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedCheckServiceProvider", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       
-       assertTrue("Assert delay", (end - begin) >= 200);
-       
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-       
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testNullableMultipleTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testNullableCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testNullableProxiedCollectionTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       boolean res = false;
-       try {
-           res = cs.check();
-       } catch(RuntimeException e) {
-           fail("A nullable was expected ...");
-       }   
-       assertFalse("Check nullable", res);
-       
-       dp.stop();
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-       return;
-   }
-   
-   public void testDelayOnMultipleDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableMultipleCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-      
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-      
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-   
-   public void testDelayOnProxiedCollectionDependency() {
-       String prov = "provider";
-       ComponentInstance provider1 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String prov2 = "provider2";
-       ComponentInstance provider2 = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov2);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-NullableProxiedColCheckServiceProviderTimeout", un);
-       
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-       
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-       
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-       
-       // Stop the providers.
-       provider1.stop();
-       provider2.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider1, 1500);
-       DelayedProvider dp2 = new DelayedProvider(provider2, 100);
-       dp.start();
-       dp2.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-       System.out.println("delay = " + (end - begin));
-       assertTrue("Assert min delay", (end - begin) >= 100);
-       assertTrue("Assert max delay", (end - begin) <= 1000);
-       dp.stop();
-       dp2.stop();
-       
-       provider1.stop();
-       provider2.stop();
-      
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       
-       assertFalse("Check invocation - 3", cs.check()); // Will return false as the contained nullable will return false to the foo method.
-
-       provider1.dispose();
-       provider2.dispose();
-       under.stop();
-       under.dispose();
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java
deleted file mode 100644
index b8d884d..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTest.java
+++ /dev/null
@@ -1,339 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.temporal.service.FooService;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class TemporalTest extends OSGiTestCase {
-
-   public void testDelay() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       assertNull("No FooService", Utils.getServiceReference(context, FooService.class.getName(), null));
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-
-       assertTrue("Assert delay (" + (end - begin) + ")", (end - begin) >= 200);
-
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-   public void testDelayWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-
-       assertTrue("Assert delay", (end - begin) >= 200);
-
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-
-   public void testTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 4000);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }
-
-       fail("Timeout expected");
-   }
-
-
-   public void testTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 4000);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }
-
-       fail("Timeout expected");
-   }
-
-
-   public void testDelayTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeoutUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-
-       assertTrue("Assert delay", (end - begin) >= 200);
-
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-   public void testDelayTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       long begin = System.currentTimeMillis();
-       DelayedProvider dp = new DelayedProvider(provider, 200);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 2", cs.check());
-       long end = System.currentTimeMillis();
-
-       assertTrue("Assert delay", (end - begin) >= 200);
-
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 3", ref_cs);
-       cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation - 3", cs.check());
-
-       provider.stop();
-       provider.dispose();
-       under.stop();
-       under.dispose();
-   }
-
-   public void testSetTimeout() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-CheckServiceProviderTimeoutUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }
-
-       fail("Timeout expected");
-   }
-
-
-   public void testSetTimeoutWithProxy() {
-       String prov = "provider";
-       ComponentInstance provider = Utils.getComponentInstanceByName(context, "TEMPORAL-FooProvider", prov);
-       String un = "under-1";
-       ComponentInstance under = Utils.getComponentInstanceByName(context, "TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal", un);
-
-       ServiceReference ref_fs = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov);
-       assertNotNull("Check foo availability", ref_fs);
-
-       ServiceReference ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability", ref_cs);
-
-       CheckService cs = (CheckService) context.getService(ref_cs);
-       assertTrue("Check invocation", cs.check());
-
-       // Stop the provider.
-       provider.stop();
-       ref_cs = Utils.getServiceReferenceByName(context, CheckService.class.getName(), un);
-       assertNotNull("Check cs availability - 2", ref_cs);
-       DelayedProvider dp = new DelayedProvider(provider, 400);
-       dp.start();
-       cs = (CheckService) context.getService(ref_cs);
-       try {
-           cs.check();
-       } catch(RuntimeException e) {
-           // OK
-           dp.stop();
-           provider.stop();
-           provider.dispose();
-           under.stop();
-           under.dispose();
-           return;
-       }
-
-       fail("Timeout expected");
-   }
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
deleted file mode 100644
index ebc01b6..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/TemporalTestSuite.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class TemporalTestSuite extends TestSuite {
-
-    public static Test suite(BundleContext bc) {
-        OSGiTestSuite ots = new OSGiTestSuite("Temporal Dependency Test Suite", bc);
-        ots.addTestSuite(NoDelayTest.class);
-        ots.addTestSuite(DelayTest.class);
-        ots.addTestSuite(NullableTest.class);
-        ots.addTestSuite(DefaultImplementationTest.class);
-        ots.addTestSuite(NullTest.class);
-        ots.addTestSuite(EmptyTest.class);
-        ots.addTestSuite(TemporalTest.class);
-        ots.addTestSuite(FilterTest.class);
-        return ots;
-    }
-
-}
-
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/BarService.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/BarService.java
deleted file mode 100644
index 9e058c9..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/CheckService.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/CheckService.java
deleted file mode 100644
index f8ec6ca..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ChildInterface.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ChildInterface.java
deleted file mode 100644
index 9aec761..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ChildInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-public interface ChildInterface extends ParentInterface1, ParentInterface2 {
-    
-    public void processChild();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/FooService.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/FooService.java
deleted file mode 100644
index 52537a1..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface1.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface1.java
deleted file mode 100644
index 373ba7e..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface1.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-public interface ParentInterface1 extends ParentParentInterface {
-    
-    public void processParent1();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface2.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface2.java
deleted file mode 100644
index 5ec4d0a..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentInterface2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-public interface ParentInterface2 {
-    
-    public void processParent2();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentParentInterface.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentParentInterface.java
deleted file mode 100644
index c4bcf4d..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/temporal/service/ParentParentInterface.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.temporal.service;
-
-public interface ParentParentInterface {
-    
-    public void processParentParent();
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index 0af896b..0000000
--- a/ipojo/tests/handler/temporal/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,353 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-    
-    public static Element getMetatadata(BundleContext bc, String component) {
-        String elem = (String) bc.getBundle().getHeaders().get("iPOJO-Components");
-        Assert.assertNotNull("iPOJO Components exists", elem);
-        try {
-            Element element = ManifestMetadataParser.parseHeaderMetadata(elem);
-            Element[] childs = element.getElements("component");
-            for (int i = 0; i < childs.length; i++) {
-                String name = childs[i].getAttribute("name");
-                String clazz = childs[i].getAttribute("classname");
-                if (name != null && name.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-                if (clazz.equalsIgnoreCase(component)) {
-                    return childs[i];
-                }
-            }
-            Assert.fail("Component " + component + " not found in " + bc.getBundle().getSymbolicName());
-        } catch (ParseException e) {
-            Assert.fail("Cannot parse the components from " + bc.getBundle().getSymbolicName() + ": " + e.getMessage());
-        }
-        
-        return null;
-        
-    }
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/handler/temporal/src/main/resources/metadata.xml b/ipojo/tests/handler/temporal/src/main/resources/metadata.xml
deleted file mode 100644
index 42262d8..0000000
--- a/ipojo/tests/handler/temporal/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,246 +0,0 @@
-<ipojo
-	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd
-	    org.apache.felix.ipojo.handler.temporal http://felix.apache.org/ipojo/schemas/SNAPSHOT/temporal.xsd"
-	xmlns="org.apache.felix.ipojo"
-	xmlns:temp="org.apache.felix.ipojo.handler.temporal">
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProvider">
-		<temp:requires field="fs"/>
-		<provides/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderUsingTemporal">
-		<temp:temporal field="fs"/>
-		<provides/>
-	</component>
-
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProvider">
-		<temp:requires field="fs" proxy="true"/>
-		<provides/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderUsingTemporal">
-		<temp:temporal field="fs" proxy="true"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300"/>
-		<provides/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-CheckServiceProviderTimeoutUsingTemporal">
-		<temp:temporal field="fs" timeout="300"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" timeout="300"/>
-		<provides/>
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-ProxiedCheckServiceProviderTimeoutUsingTemporal">
-		<temp:temporal field="fs" proxy="true" timeout="300"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-MultipleCheckServiceProvider">
-		<temp:requires field="fs" id="foo"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-ColCheckServiceProvider">
-		<temp:requires field="fs" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-ProxiedColCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.FooProvider" name="TEMPORAL-FooProvider">
-		<provides/>
-	</component>
-
-	<!-- Dependencies using nullables -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="nullable"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullableColCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="nullable" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullableProxiedColCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="nullable" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="nullable"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullableProxiedCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="nullable"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullableCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="nullable"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullableProxiedCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" onTimeout="nullable" timeout="300"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullableMultipleCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="nullable"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullableColCheckServiceProviderTimeout">
-		<temp:requires field="fs" onTimeout="nullable" timeout="300" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullableProxiedColCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" onTimeout="nullable" timeout="300" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<!-- Dependencies using default implementation -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-DIColCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-DIProxiedColCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProvider">
-		<temp:requires field="fs" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-DIProxiedCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-DICheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-DIProxiedCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-DIMultipleCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-DIColCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-DIProxiedColCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" timeout="300" onTimeout="org.apache.felix.ipojo.test.scenarios.component.NullableFooProvider" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<!-- Dependencies using null -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullColCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullProxiedColCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullProxiedCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CheckServiceProvider" name="TEMPORAL-NullCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCheckServiceProvider" name="TEMPORAL-NullProxiedCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" timeout="300" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-NullMultipleCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="null"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-NullColCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-NullProxiedColCheckServiceProviderTimeout">
-		<temp:requires field="fs" proxy="true" timeout="300" onTimeout="null" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<!-- Dependencies using empty arrays -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="empty-array"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-EmptyColCheckServiceProvider">
-		<temp:requires field="fs" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-EmptyProxiedColCheckServiceProvider">
-		<temp:requires field="fs" proxy="true" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckServiceProvider" name="TEMPORAL-EmptyMultipleCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="empty-array"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.CollectionCheckServiceProvider" name="TEMPORAL-EmptyColCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.proxy.HelpedCollectionCheckServiceProvider" name="TEMPORAL-EmptyProxiedColCheckServiceProviderTimeout">
-		<temp:requires field="fs" timeout="300" proxy="true" onTimeout="empty" specification="org.apache.felix.ipojo.test.scenarios.temporal.service.FooService"/>
-		<provides/>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/pom.xml b/ipojo/tests/handler/transaction/pom.xml
deleted file mode 100644
index 9c355ca..0000000
--- a/ipojo/tests/handler/transaction/pom.xml
+++ /dev/null
@@ -1,173 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <groupId>ipojo.tests</groupId>
-  <artifactId>tests.transactions</artifactId>
-  <packaging>jar</packaging>
-  <version>1.5.0-SNAPSHOT</version>
-  <name>iPOJO Transaction Handler Test Suite</name>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-      <version>${ipojo.core.release}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.transaction</groupId>
-      <artifactId>geronimo-transaction-service</artifactId>
-      <version>0.0.1-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.handler.transaction</artifactId>
-      <version>${project.version}</version>
-    </dependency>
-
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>osgi-helpers</artifactId>
-    </dependency>
-    <!-- Pax Exam API: -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <!-- During runtime Pax Exam will discover the OSGi container to use by
-      searching metadata available into classpath. Pax Exam comes with a default
-      container that uses [Pax Runner] for implementing the container requirements: -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-container-default
-    </artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <!-- If your test code is based on JUnit you will have to have the Junit
-      support artifact: -->
-    <dependency>
-      <groupId>org.ops4j.pax.exam</groupId>
-      <artifactId>pax-exam-junit</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>4.5</version>
-      <type>jar</type>
-      <scope>test</scope>
-    </dependency>
-    <!-- Tinybundles -->
-    <dependency>
-      <groupId>org.ops4j.pax.swissbox</groupId>
-      <artifactId>pax-swissbox-tinybundles</artifactId>
-      <version>1.2.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.ow2.chameleon.testing</groupId>
-      <artifactId>tinybundles-ipojo</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>xerces</groupId>
-      <artifactId>xercesImpl</artifactId>
-      <version>2.4.0</version>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.logging</groupId>
-      <artifactId>pax-logging-api</artifactId>
-      <version>1.4</version>
-    </dependency>
-    <dependency>
-      <groupId>org.ops4j.pax.logging</groupId>
-      <artifactId>pax-logging-service</artifactId>
-      <version>1.4</version>
-      <exclusions>
-        <exclusion>
-          <artifactId>jmxtools</artifactId>
-          <groupId>com.sun.jdmk</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>jmxri</artifactId>
-          <groupId>com.sun.jmx</groupId>
-        </exclusion>
-        <exclusion>
-          <artifactId>mail</artifactId>
-          <groupId>javax.mail</groupId>
-        </exclusion>
-      </exclusions>
-    </dependency>
-
-  </dependencies>
-
-  <repositories>
-    <repository>
-      <id>ops4j.releases</id>
-      <name>OPS4J Release</name>
-      <url> http://repository.ops4j.org/maven2/</url>
-      <releases>
-        <enabled>true</enabled>
-      </releases>
-      <snapshots>
-        <enabled>false</enabled>
-      </snapshots>
-    </repository>
-  </repositories>
-
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.servicemix.tooling</groupId>
-        <artifactId>depends-maven-plugin</artifactId>
-        <version>1.2</version>
-        <executions>
-          <execution>
-            <id>generate-depends-file</id>
-            <goals>
-              <goal>generate-depends-file</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestAnnotations.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestAnnotations.java
deleted file mode 100644
index c88a261..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestAnnotations.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ops4j.pax.exam.CoreOptions.*;
-import static org.ops4j.pax.exam.container.def.PaxRunnerOptions.*;
-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 static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.io.InputStream;
-
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.transaction.test.component.ComponentUsingAnnotations;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestAnnotations {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-            .add(CheckService.class)
-            .add(Foo.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build( TinyBundles.withBnd());
-
-        InputStream fooimpl = TinyBundles.newBundle()
-            .add(FooImpl.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-            .add(ComponentUsingAnnotations.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"TransactionAnnotationTest")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-            .build( withiPOJO(new File(ROOT, "annotations.jar"), new File(TEST, "annotation.xml"))  );
-
-
-        Option[] opt =  options(
-
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                ),
-                repository("http://maven.ow2.org/maven2-snapshot/")
-                );
-        return opt;
-    }
-
-    @Test
-    public void annotations() {
-        Element elem = IPOJOHelper.getMetadata(getBundle(), "org.apache.felix.ipojo.transaction.test.component.ComponentUsingAnnotations");
-        Assert.assertNotNull(elem);
-
-        Element tr = elem.getElements("transaction", "org.apache.felix.ipojo.transaction")[0];
-        Assert.assertEquals("transaction", tr.getAttribute("field"));
-
-        Assert.assertNull(tr.getAttribute("oncommit"));
-        Assert.assertNull(tr.getAttribute("onrollback"));
-
-        Element[] methods = tr.getElements();
-        Assert.assertEquals(4, methods.length);
-
-        Element m1 = getElementByMethod(methods, "doSomethingBad");
-        Assert.assertNotNull(m1);
-
-        Element m2 = getElementByMethod(methods, "doSomethingBad2");
-        Assert.assertNotNull(m2);
-        Assert.assertEquals("required", m2.getAttribute("propagation"));
-
-        Element m3 = getElementByMethod(methods, "doSomethingGood");
-        Assert.assertNotNull(m3);
-        Assert.assertEquals("supported", m3.getAttribute("propagation"));
-        Assert.assertEquals("{java.lang.Exception}", m3.getAttribute("norollbackfor"));
-
-        Element m4 = getElementByMethod(methods, "doSomethingLong");
-        Assert.assertNotNull(m4);
-        Assert.assertEquals("1000", m4.getAttribute("timeout"));
-        Assert.assertEquals("true", m4.getAttribute("exceptiononrollback"));
-    }
-
-    private Element getElementByMethod(Element[] e, String m) {
-        for(Element elem : e) {
-            if(m.equals(elem.getAttribute("method"))) {
-                return elem;
-            }
-        }
-        Assert.fail("Method " + m + " not found");
-        return null;
-    }
-
-    private Bundle getBundle() {
-        for(Bundle b : context.getBundles()) {
-            System.out.println(b.getSymbolicName());
-           if ("TransactionAnnotationTest".equals(b.getSymbolicName())) {
-               return b;
-           }
-        }
-        Assert.fail("Cannot find the tested bundle");
-        return null;
-    }
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInstallation.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInstallation.java
deleted file mode 100644
index a916973..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInstallation.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.SystemException;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestInstallation {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-            .add(CheckService.class)
-            .add(Foo.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build();
-
-//        try {
-//            StreamUtils.copy(service, new FileOutputStream(new File(ROOT, "service.jar")));
-//        } catch (Exception e) {
-//            e.printStackTrace();
-//        }
-
-        InputStream fooimpl = TinyBundles.newBundle()
-            .add(FooImpl.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-            .add(FooDelegator.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"RequiredTransactionPropagation")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-            .build( withiPOJO(new File(ROOT, "requires.jar"), new File(TEST, "requires.xml"))  );
-
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-        return opt;
-    }
-
-    @Test
-    public void install() throws NotSupportedException, SystemException, IllegalStateException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException, InvalidSyntaxException {
-        Bundle[] bundles = context.getBundles();
-        for (Bundle b : bundles) {
-            Assert.assertTrue(b.getSymbolicName(), b.getState() == Bundle.ACTIVE);
-        }
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        // Transaction Service available
-        osgi.isServiceAvailable(TransactionManager.class.getName());
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Assert.assertNotNull(tm.getTransaction());
-        tm.commit();
-
-        tm.begin();
-        Assert.assertNotNull(tm.getTransaction());
-        tm.rollback();
-
-        // Handler exposed
-        ServiceReference ref = osgi.getServiceReference(HandlerFactory.class.getName(), "(&(handler.name=transaction)(handler.namespace=org.apache.felix.ipojo.transaction))");
-        Assert.assertNotNull(ref);
-
-        // Create an install of the components
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference[] refs = context.getAllServiceReferences(CheckService.class.getName(), "(instance.name=" + under.getInstanceName() +")");
-
-//        ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(refs);
-
-        ((CheckService) osgi.getServiceObject(refs[0])).doSomethingGood();
-    }
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInvalidation.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInvalidation.java
deleted file mode 100644
index 4a2e173..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestInvalidation.java
+++ /dev/null
@@ -1,164 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-import static org.ops4j.pax.exam.CoreOptions.mavenBundle;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestInvalidation {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-
-        InputStream service = TinyBundles.newBundle()
-            .add(CheckService.class)
-            .add(Foo.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-            .add(FooImpl.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-            .add(FooDelegator.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"RequiredTransactionPropagation")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-            .build( withiPOJO(new File(ROOT, "requires.jar"), new File(TEST, "requires.xml"))  );
-
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-        return opt;
-    }
-
-
-
-
-    @Test
-    public void testInvalidation() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        final ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-
-        Thread thread = new Thread (new Runnable() {
-           public void run() {
-               try {
-                Thread.sleep(2000);
-            } catch (InterruptedException e) {
-                e.printStackTrace();
-            }
-               prov.dispose();
-           }
-        });
-
-        thread.start();
-
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingLong(); // 5s, so prov should be disposed during this time and under becomes invalid
-
-        Assert.assertEquals(ComponentInstance.INVALID, under.getState());
-
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.rollback();
-    }
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestMandatory.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestMandatory.java
deleted file mode 100644
index ed305fb..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestMandatory.java
+++ /dev/null
@@ -1,435 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestMandatory {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-            .add(CheckService.class)
-            .add(Foo.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-            .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-            .add(FooImpl.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-            .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-            .add(FooDelegator.class)
-            .set(Constants.BUNDLE_SYMBOLICNAME,"MandatoryTransactionPropagation")
-            .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-            .build( withiPOJO(new File(ROOT, "mandatory.jar"), new File(TEST, "mandatory.xml")) );
-
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-        return opt;
-    }
-
-
-    @Test(expected=RuntimeException.class)
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingGood(); // Fail !
-    }
-
-    @Test
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad(); // Fail, RTE thrown before the other exception
-    }
-
-    @Test(expected=RollbackException.class)
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.commit(); // Throws a rollback exception.
-    }
-
-    @Test
-    public void testExceptionInsideTransactionRB() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.rollback();
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2(); // Throws a RTE
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testOkOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingGood(); // Throws a RTE.
-
-    }
-
-    @Test
-    public void testOkInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad(); // Thows a RTE.
-
-    }
-
-    @Test
-    public void testExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        try {
-            t.commit(); // Throw a rollback exception.
-        } catch (RollbackException e) {
-            // Expected
-        } catch (Throwable e) {
-            Assert.fail(e.getMessage()); // Unexpected
-        }
-
-        Assert.assertNotNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(1, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastRolledBack());
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testExpectedExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad2();
-
-
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("mandatory-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNever.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNever.java
deleted file mode 100644
index 64fc423..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNever.java
+++ /dev/null
@@ -1,209 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestNever {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-        .add(CheckService.class)
-        .add(Foo.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-        .add(FooImpl.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-        .add(FooDelegator.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"NeverTransactionPropagation")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-        .build( withiPOJO(new File(ROOT, "never.jar"), new File(TEST, "never.xml"))  );
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-        return opt;
-    }
-
-
-    @Test
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("never-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingGood();
-    }
-
-    @Test(expected=RuntimeException.class)
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("never-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        cs.doSomethingGood(); // Fail
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("never-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad(); // Throws an NPE
-    }
-
-    @Test
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("never-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad(); // Fail
-            Assert.fail("RuntimeException expected");
-        } catch(RuntimeException e) {
-            Assert.assertTrue(e instanceof RuntimeException);
-        }
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.rollback();
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("never-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2();
-    }
-
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNotSupported.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNotSupported.java
deleted file mode 100644
index 7978e9e..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestNotSupported.java
+++ /dev/null
@@ -1,440 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestNotSupported {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-        .add(CheckService.class)
-        .add(Foo.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-        .add(FooImpl.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-        .add(FooDelegator.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"NotSupportedTransactionPropagation")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-        .build( withiPOJO(new File(ROOT, "notsupported.jar"), new File(TEST, "notsupported.xml"))  );
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-        return opt;
-    }
-
-
-    @Test
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = ((CheckService) osgi.getServiceObject(ref));
-        cs.doSomethingGood();
-        // No transaction.
-    }
-
-    @Test
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction(); // Is executed in the transaction despite it's not supported.
-        Assert.assertSame(t2, t);
-        t.commit();
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad();
-    }
-
-    @Test
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus()); // No impact on the transaction.
-
-        t.commit(); // Ok.
-    }
-
-    @Test
-    public void testExceptionInsideTransactionRB() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus()); // No impact on the transaction.
-
-        t.rollback(); // Ok.
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2();
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-
-    @Test
-    public void testOkOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingGood();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testOkInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus()); // No effect on the transaction
-
-        try {
-            t.commit(); // Throw a rollback exception.
-        } catch (RollbackException e) {
-            // Expected
-        } catch (Throwable e) {
-            Assert.fail(e.getMessage()); // Unexpected
-        }
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad2();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("notsupported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequires.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequires.java
deleted file mode 100644
index 52629e0..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequires.java
+++ /dev/null
@@ -1,445 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestRequires {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-        .add(CheckService.class)
-        .add(Foo.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-        .add(FooImpl.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-        .add(FooDelegator.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"RequiresTransactionPropagation")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-        .build( withiPOJO(new File(ROOT, "requires.jar"), new File(TEST, "requires.xml"))   );
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-        return opt;
-    }
-
-
-    @Test
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingGood();
-    }
-
-    @Test
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad();
-    }
-
-    @Test(expected=RollbackException.class)
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.commit(); // Throw a rollback exception.
-    }
-
-    @Test
-    public void testExceptionInsideTransactionRB() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.rollback();
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2();
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-
-    @Test
-    public void testOkOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingGood();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testOkInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad();
-
-        Assert.assertNotNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(1, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        try {
-            t.commit(); // Throw a rollback exception.
-        } catch (RollbackException e) {
-            // Expected
-        } catch (Throwable e) {
-            Assert.fail(e.getMessage()); // Unexpected
-        }
-
-        Assert.assertNotNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(1, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastRolledBack());
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad2();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requires-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequiresNew.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequiresNew.java
deleted file mode 100644
index e1e554c..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestRequiresNew.java
+++ /dev/null
@@ -1,256 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestRequiresNew {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-
-        InputStream service = TinyBundles.newBundle()
-        .add(CheckService.class)
-        .add(Foo.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-        .add(FooImpl.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-        .add(FooDelegator.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"RequiresNewTransactionPropagation")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-        .build( withiPOJO(new File(ROOT, "requiresnew.jar"), new File(TEST, "requiresnew.xml"))  );
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-
-        return opt;
-    }
-
-
-    @Test
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingGood(); // Ok
-    }
-
-    @Test
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertNotSame(t2, t); // Two different transactions
-        // Check that t2 is commited => no transaction
-        Assert.assertEquals(Status.STATUS_NO_TRANSACTION, t2.getStatus());
-        t.commit();
-    }
-
-    @Test
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        try {
-            ((CheckService) osgi.getServiceObject(ref)).doSomethingBad(); // throws an exception on rollback
-            Assert.fail("Exception expected on rollback");
-        } catch (IllegalStateException e) {
-            // Ok.
-        } catch (Exception  e) {
-            Assert.fail("IllegalStateException expected on rollback");
-        }
-    }
-
-    @Test
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("IllegalStateException expected");  // throws an exception on rollback
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof IllegalStateException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertNotSame(t2, t);
-        // Check that t2 is rolledback
-        Assert.assertEquals(Status.STATUS_NO_TRANSACTION, t2.getStatus());
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2();
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("requiresnew-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertNotSame(t2, t);
-        Assert.assertEquals(Status.STATUS_NO_TRANSACTION, t2.getStatus());
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestSupported.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestSupported.java
deleted file mode 100644
index 4bc653d..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/TestSupported.java
+++ /dev/null
@@ -1,447 +0,0 @@
-package org.apache.felix.ipojo.transaction.test;
-
-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 static org.ops4j.pax.exam.container.def.PaxRunnerOptions.repository;
-
-import java.io.File;
-import java.io.InputStream;
-
-import javax.transaction.HeuristicMixedException;
-import javax.transaction.HeuristicRollbackException;
-import javax.transaction.NotSupportedException;
-import javax.transaction.RollbackException;
-import javax.transaction.Status;
-import javax.transaction.SystemException;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.transaction.test.component.FooDelegator;
-import org.apache.felix.ipojo.transaction.test.component.FooImpl;
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
-import org.osgi.framework.ServiceReference;
-import org.ow2.chameleon.testing.helpers.IPOJOHelper;
-import org.ow2.chameleon.testing.helpers.OSGiHelper;
-import static org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOBuilder.withiPOJO;
-
-@RunWith( JUnit4TestRunner.class )
-public class TestSupported {
-
-    @Inject
-    private BundleContext context;
-
-    private OSGiHelper osgi;
-
-    private IPOJOHelper ipojo;
-    public static final File ROOT = new File("target/tmp");
-    public static final File TEST = new File("src/test/resources");
-
-
-    @Before
-    public void init() {
-        osgi = new OSGiHelper(context);
-        ipojo = new IPOJOHelper(context);
-    }
-
-    @After
-    public void stop() {
-        ipojo.dispose();
-        osgi.dispose();
-    }
-
-    @Configuration
-    public static Option[] configure() {
-        ROOT.mkdirs();
-
-        InputStream service = TinyBundles.newBundle()
-        .add(CheckService.class)
-        .add(Foo.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Service")
-        .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build();
-
-        InputStream fooimpl = TinyBundles.newBundle()
-        .add(FooImpl.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"Foo Provider")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-        .build( withiPOJO(new File(ROOT, "FooImpl.jar"), new File(TEST, "foo.xml"))  );
-
-        InputStream test = TinyBundles.newBundle()
-        .add(FooDelegator.class)
-        .set(Constants.BUNDLE_SYMBOLICNAME,"SupportedTransactionPropagation")
-        .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service, javax.transaction;version=1.1")
-        .build( withiPOJO(new File(ROOT, "supported.jar"), new File(TEST, "supported.xml"))    );
-
-        Option[] opt =  options(
-                provision(
-                        mavenBundle().groupId("org.ops4j.pax.logging").artifactId("pax-logging-api").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo").version(asInProject()),
-                        mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.ipojo.handler.transaction").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.transaction").artifactId("geronimo-transaction-service").version(asInProject()),
-                        mavenBundle().groupId("org.ow2.chameleon.testing").artifactId("osgi-helpers").versionAsInProject()
-                ),
-                provision(
-                        service,
-                        fooimpl,
-                        test
-                    ),
-                repository("http://maven.ow2.org/maven2-snapshot/"),
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe( InputStream testProbe )
-                    {
-                       return TinyBundles.modifyBundle(testProbe)
-                           .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.transaction.test.service")
-                           .build();
-                    }
-                });
-
-
-        return opt;
-    }
-
-
-    @Test
-    public void testOkOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = ((CheckService) osgi.getServiceObject(ref));
-        cs.doSomethingGood();
-        // No transaction.
-    }
-
-    @Test
-    public void testOkInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad();
-    }
-
-    @Test(expected=RollbackException.class)
-    public void testExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.commit(); // Throw a rollback exception.
-    }
-
-    @Test
-    public void testExceptionInsideTransactionRB() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        t.rollback();
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransaction() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        ((CheckService) osgi.getServiceObject(ref)).doSomethingBad2();
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransaction() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-ok");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-    }
-
-    @Test
-    public void testOkOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingGood();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testOkInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        cs.doSomethingGood();
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-    @Test(expected=NullPointerException.class)
-    public void testExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad();
-            Assert.fail("NullPointerException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof NullPointerException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_MARKED_ROLLBACK, t.getStatus());
-
-        try {
-            t.commit(); // Throw a rollback exception.
-        } catch (RollbackException e) {
-            // Expected
-        } catch (Throwable e) {
-            Assert.fail(e.getMessage()); // Unexpected
-        }
-
-        Assert.assertNotNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(1, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastRolledBack());
-    }
-
-    @Test(expected=UnsupportedOperationException.class)
-    public void testExpectedExceptionOutsideTransactionWithCallback() {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-
-        cs.doSomethingBad2();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNull(cs.getLastCommitted());
-        Assert.assertEquals(0, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-    }
-
-    @Test
-    public void testExpectedExceptionInsideTransactionWithCallback() throws NotSupportedException, SystemException, SecurityException, HeuristicMixedException, HeuristicRollbackException, RollbackException {
-        ComponentInstance prov = ipojo.createComponentInstance("org.apache.felix.ipojo.transaction.test.component.FooImpl");
-        ComponentInstance under = ipojo.createComponentInstance("supported-cb");
-
-        Assert.assertEquals(ComponentInstance.VALID, prov.getState());
-        Assert.assertEquals(ComponentInstance.VALID, under.getState());
-
-        ServiceReference ref = ipojo.getServiceReferenceByName(CheckService.class.getName(), under.getInstanceName());
-        Assert.assertNotNull(ref);
-
-        osgi.waitForService(TransactionManager.class.getName(), null, 5000);
-        CheckService cs = (CheckService) osgi.getServiceObject(ref);
-        TransactionManager tm = (TransactionManager) osgi.getServiceObject(TransactionManager.class.getName(), null);
-        tm.begin();
-        Transaction t = tm.getTransaction();
-        try {
-            cs.doSomethingBad2();
-            Assert.fail("UnsupportedOperationException expected");
-        } catch(Exception e) {
-            Assert.assertTrue(e instanceof UnsupportedOperationException);
-        }
-        Transaction t2 = cs.getCurrentTransaction();
-        Assert.assertSame(t2, t);
-        Assert.assertEquals(Status.STATUS_ACTIVE, t.getStatus());
-
-        t.commit();
-
-        Assert.assertNull(cs.getLastRolledBack());
-        Assert.assertNotNull(cs.getLastCommitted());
-        Assert.assertEquals(1, cs.getNumberOfCommit());
-        Assert.assertEquals(0, cs.getNumberOfRollback());
-
-        Assert.assertSame(t, cs.getLastCommitted());
-    }
-
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/ComponentUsingAnnotations.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/ComponentUsingAnnotations.java
deleted file mode 100644
index d2db5f1..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/ComponentUsingAnnotations.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package org.apache.felix.ipojo.transaction.test.component;
-
-import javax.transaction.Transaction;
-
-import org.apache.felix.ipojo.annotations.Component;
-
-@Component
-@org.apache.felix.ipojo.transaction.Transaction(field="transaction")
-public class ComponentUsingAnnotations {
-
-    Transaction transaction;
-
-
-    @org.apache.felix.ipojo.transaction.Transactional
-    public void doSomethingBad() throws NullPointerException {
-    }
-
-    @org.apache.felix.ipojo.transaction.Transactional(propagation="required")
-    public void doSomethingBad2() throws UnsupportedOperationException {
-
-    }
-
-    @org.apache.felix.ipojo.transaction.Transactional(propagation="supported", norollbackfor= {"java.lang.Exception"})
-    public void doSomethingGood() {
-
-    }
-
-    @org.apache.felix.ipojo.transaction.Transactional(timeout=1000, exceptiononrollback=true)
-    public void doSomethingLong() {
-
-    }
-
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooDelegator.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooDelegator.java
deleted file mode 100644
index 7f8665b..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooDelegator.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package org.apache.felix.ipojo.transaction.test.component;
-
-import javax.transaction.Transaction;
-
-import org.apache.felix.ipojo.transaction.test.service.CheckService;
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-
-public class FooDelegator implements CheckService {
-    
-    private Foo foo;
-    
-    private int commit;
-    
-    private int rollback;
-    
-    Transaction transaction;
-    
-    Transaction lastCommitted;
-    
-    Transaction lastRolledback;
-    
-    Transaction current;
-
-    
-    public void onCommit(String method) {
-        commit ++;
-    }
-    
-    public void onRollback(String method, Exception e) {
-        rollback ++;
-    }
-
-    public void doSomethingBad() throws NullPointerException {
-        current = transaction;
-        foo.doSomethingBad();
-    }
-
-    public void doSomethingBad2() throws UnsupportedOperationException {
-       current = transaction;
-       foo.doSomethingBad2();
-
-    }
-
-    public void doSomethingGood() {
-        current = transaction;
-        foo.doSomethingGood();
-    }
-
-    public void doSomethingLong() {
-       current = transaction;
-       foo.doSomethingLong();
-    }
-
-    public Transaction getCurrentTransaction() {
-       return current;
-    }
-
-    public int getNumberOfCommit() {
-       return commit;
-    }
-
-    public int getNumberOfRollback() {
-       return rollback;
-    }
-    
-    public Transaction getLastRolledBack() {
-        return lastRolledback;
-    }
-    
-    public Transaction getLastCommitted() {
-        return lastCommitted;
-    }
-    
-    public void onRollback(Transaction t) {
-        lastRolledback = t;
-        rollback ++;
-    }
-    
-
-    public void onCommit(Transaction t) {
-        lastCommitted = t;
-        commit ++;
-    }
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooImpl.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooImpl.java
deleted file mode 100644
index addb9f3..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/component/FooImpl.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package org.apache.felix.ipojo.transaction.test.component;
-
-import org.apache.felix.ipojo.transaction.test.service.Foo;
-
-public class FooImpl implements Foo {
-
-    public void doSomethingBad() throws NullPointerException {
-       throw new NullPointerException("NULL");
-    }
-
-    public void doSomethingBad2() throws UnsupportedOperationException {
-        throw new UnsupportedOperationException("Expected exception");
-
-    }
-
-    public void doSomethingGood() {
-       // Good...
-    }
-
-    public void doSomethingLong() {
-        try {
-            Thread.sleep(5000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-    }
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/CheckService.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/CheckService.java
deleted file mode 100644
index bb95994..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/CheckService.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package org.apache.felix.ipojo.transaction.test.service;
-
-import javax.transaction.Transaction;
-
-public interface CheckService {
-    
-    public void doSomethingGood();
-    
-    public void doSomethingBad() throws NullPointerException;
-    
-    public void doSomethingBad2() throws UnsupportedOperationException;
-    
-    public void doSomethingLong();
-    
-    public int getNumberOfCommit();
-    
-    public int getNumberOfRollback();
-    
-    public Transaction getCurrentTransaction();
-    
-    public Transaction getLastRolledBack();
-    
-    public Transaction getLastCommitted();
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/Foo.java b/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/Foo.java
deleted file mode 100644
index b1ba75a..0000000
--- a/ipojo/tests/handler/transaction/src/test/java/org/apache/felix/ipojo/transaction/test/service/Foo.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.transaction.test.service;
-
-public interface Foo {
-    
-    public void doSomethingGood();
-    
-    public void doSomethingBad() throws NullPointerException;
-    
-    public void doSomethingBad2() throws UnsupportedOperationException;
-    
-    public void doSomethingLong();
-
-}
diff --git a/ipojo/tests/handler/transaction/src/test/resources/annotation.xml b/ipojo/tests/handler/transaction/src/test/resources/annotation.xml
deleted file mode 100644
index d1aa123..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/annotation.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/foo.xml b/ipojo/tests/handler/transaction/src/test/resources/foo.xml
deleted file mode 100644
index 19f1ed8..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/foo.xml
+++ /dev/null
@@ -1,5 +0,0 @@
-<ipojo>
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooImpl">
-		<provides/>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml b/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml
deleted file mode 100644
index eb743bf..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/mandatory.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="mandatory-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood" propagation="mandatory"/>
-			<transactional method="getCurrentTransaction" propagation="mandatory"/>
-			<transactional method="doSomethingBad" propagation="mandatory"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
-			<transactional method="doSomethingLong" propagation="mandatory"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="mandatory-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood" propagation="mandatory"/>
-			<transactional method="getCurrentTransaction" propagation="mandatory"/>
-			<transactional method="doSomethingBad" propagation="mandatory"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="mandatory"/>
-			<transactional method="doSomethingLong" propagation="mandatory"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/never.xml b/ipojo/tests/handler/transaction/src/test/resources/never.xml
deleted file mode 100644
index 8170a46..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/never.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="never-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood" propagation="never"/>
-			<transactional method="getCurrentTransaction" propagation="never"/>
-			<transactional method="doSomethingBad" propagation="never"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
-			<transactional method="doSomethingLong" propagation="never"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="never-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood" propagation="never"/>
-			<transactional method="getCurrentTransaction" propagation="never"/>
-			<transactional method="doSomethingBad" propagation="never"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="never"/>
-			<transactional method="doSomethingLong" propagation="never"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml b/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml
deleted file mode 100644
index 7a471c8..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/notsupported.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="notsupported-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood" propagation="notsupported"/>
-			<transactional method="getCurrentTransaction" propagation="notsupported"/>
-			<transactional method="doSomethingBad" propagation="notsupported"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
-			<transactional method="doSomethingLong" propagation="notsupported"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="notsupported-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood" propagation="notsupported"/>
-			<transactional method="getCurrentTransaction" propagation="notsupported"/>
-			<transactional method="doSomethingBad" propagation="notsupported"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="notsupported"/>
-			<transactional method="doSomethingLong" propagation="notsupported"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/requires.xml b/ipojo/tests/handler/transaction/src/test/resources/requires.xml
deleted file mode 100644
index 20a5844..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/requires.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requires-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood"/>
-			<transactional method="getCurrentTransaction"/>
-			<transactional method="doSomethingBad"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
-			<transactional method="doSomethingLong"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requires-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood"/>
-			<transactional method="getCurrentTransaction"/>
-			<transactional method="doSomethingBad"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException"/>
-			<transactional method="doSomethingLong"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml b/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml
deleted file mode 100644
index 30d2ad6..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/requiresnew.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requiresnew-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood" propagation="requiresnew"/>
-			<transactional method="getCurrentTransaction" propagation="requiresnew"/>
-			<transactional method="doSomethingBad" propagation="requiresnew" exceptiononrollback="true"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
-			<transactional method="doSomethingLong" propagation="requiresnew"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="requiresnew-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood" propagation="requiresnew"/>
-			<transactional method="getCurrentTransaction" propagation="requiresnew"/>
-			<transactional method="doSomethingBad" propagation="requiresnew"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="requiresnew"/>
-			<transactional method="doSomethingLong" propagation="requiresnew"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/transaction/src/test/resources/supported.xml b/ipojo/tests/handler/transaction/src/test/resources/supported.xml
deleted file mode 100644
index b45a7f1..0000000
--- a/ipojo/tests/handler/transaction/src/test/resources/supported.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-<ipojo xmlns:tr="org.apache.felix.ipojo.transaction">
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="supported-ok">
-		<provides/>
-		<requires field="foo"/>
-		<tr:transaction field="transaction">
-			<transactional method="doSomethingGood" propagation="supported"/>
-			<transactional method="getCurrentTransaction" propagation="supported"/>
-			<transactional method="doSomethingBad" propagation="supported"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
-			<transactional method="doSomethingLong" propagation="supported"/>
-		</tr:transaction>
-	</component>
-	
-	<component classname="org.apache.felix.ipojo.transaction.test.component.FooDelegator" name="supported-cb">
-		<provides/>
-		<requires field="foo" />
-		<tr:transaction field="transaction" onCommit="onCommit" onRollback="onRollback">
-			<transactional method="doSomethingGood" propagation="supported"/>
-			<transactional method="getCurrentTransaction" propagation="supported"/>
-			<transactional method="doSomethingBad" propagation="supported"/>
-			<transactional method="doSomethingBad2" norollbackfor="java.lang.UnsupportedOperationException" propagation="supported"/>
-			<transactional method="doSomethingLong" propagation="supported"/>
-		</tr:transaction>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/handler/whiteboard/pom.xml b/ipojo/tests/handler/whiteboard/pom.xml
deleted file mode 100644
index 025f7c0..0000000
--- a/ipojo/tests/handler/whiteboard/pom.xml
+++ /dev/null
@@ -1,161 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <parent>
-        <groupId>ipojo.tests</groupId>
-        <artifactId>ipojo.tests</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../../pom.xml</relativePath>
-    </parent>
-    <groupId>ipojo.tests</groupId>
-    <version>${ipojo.wbp.snapshot}</version>
-    <modelVersion>4.0.0</modelVersion>
-    <packaging>bundle</packaging>
-    <name>iPOJO White Board Pattern Handler Test Suite</name>
-    <artifactId>tests.whiteboard</artifactId>
-    <dependencies>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo</artifactId>
-            <version>${ipojo.core.snapshot}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.handler.whiteboard</artifactId>
-             <version>${ipojo.wbp.snapshot}</version>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>3.8.1</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-            <version>1.1.0-SNAPSHOT</version>
-        </dependency>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.compendium</artifactId>
-            <version>4.0.0</version>
-        </dependency>
-    </dependencies>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-bundle-plugin</artifactId>
-                <extensions>true</extensions>
-                <configuration>
-                    <instructions>
-                        <Private-Package>org.apache.felix.ipojo.test,
-                            org.apache.felix.ipojo.test.scenarios.util</Private-Package>
-                        <Test-Suite>org.apache.felix.ipojo.test.WbpTests</Test-Suite>
-                    </instructions>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-ipojo-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>ipojo-bundle</goal>
-                        </goals>
-                        <configuration>
-                            <ignoreAnnotations>true</ignoreAnnotations>
-                            <metadata>
-             <![CDATA[
-             <ipojo
-              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-            xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-            xmlns="org.apache.felix.ipojo"
-            xmlns:wbp="org.apache.felix.ipojo.whiteboard">
-            <component classname="org.apache.felix.ipojo.test.FooProvider" name="fooprovider">
-              <provides>
-                <property field="foo" value="foo"/>
-              </provides>
-            </component>
-
-            <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers">
-                <wbp:wbp
-                  filter="(objectclass=org.apache.felix.ipojo.test.FooService)"
-                  onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"
-                />
-                <provides/>
-            </component>
-
-            <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-properties">
-                <wbp:wbp filter="(foo=foo)" onArrival="onArrival" onDeparture="onDeparture"
-                  onModification="onModification"
-                />
-                <provides/>
-            </component>
-
-            <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers-2">
-                <wbp:whiteboards>
-                  <wbp:wbp
-                    filter="(objectclass=org.apache.felix.ipojo.test.FooService)"
-                    onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"
-                  />
-                </wbp:whiteboards>
-                <provides/>
-            </component>
-
-            <component classname="org.apache.felix.ipojo.test.FooWhiteBoardPattern" name="under-providers-lifecycle">
-                <wbp:wbp
-                  filter="(objectclass=org.apache.felix.ipojo.test.FooService)"
-                  onArrival="onArrival" onDeparture="onDeparture" onModification="onModification"
-                />
-                <provides/>
-                <callback transition="validate" method="start"/>
-                <callback transition="invalidate" method="stop"/>
-            </component>
-          </ipojo>
-          ]]>
-                            </metadata>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-junit4osgi-plugin</artifactId>
-                <version>1.1.0-SNAPSHOT</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <configuration>
-                                <org.osgi.http.port>8083</org.osgi.http.port>
-                            </configuration>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-</project>
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooProvider.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooProvider.java
deleted file mode 100644
index 5a996cd..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooProvider.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test;
-
-public class FooProvider implements FooService {
-    
-    public String foo;
-
-    public void foo() { 
-        if (foo.equals("foo")) {
-            foo = "bar";
-        } else {
-            foo = "foo";
-        }
-    }
-    
-}
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooService.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooService.java
deleted file mode 100644
index 0040354..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooService.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test;
-
-public interface FooService {
-    
-    public void foo();
-
-}
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java
deleted file mode 100644
index 4974e45..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/FooWhiteBoardPattern.java
+++ /dev/null
@@ -1,74 +0,0 @@
-package org.apache.felix.ipojo.test;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.osgi.framework.ServiceReference;
-
-public class FooWhiteBoardPattern implements Observable {
-
-    List list = new ArrayList();
-    int modifications = 0;
-
-    long validate_time = 0;
-    long first_arrival_time = 0;
-    long first_departure_time = 0;
-    long invalidate_time = 0;
-
-    public void onArrival(ServiceReference ref) {
-    	if (first_arrival_time == 0) {
-    		first_arrival_time = System.currentTimeMillis();
-    		try {
-				Thread.sleep(10);
-			} catch (InterruptedException e) {	}
-    	}
-        list.add(ref);
-    }
-
-    public void onDeparture(ServiceReference ref) {
-        list.remove(ref);
-        if (first_departure_time == 0) {
-        	first_departure_time = System.currentTimeMillis();
-    		try {
-				Thread.sleep(10);
-			} catch (InterruptedException e) {	}
-    	}
-    }
-
-    public void onModification(ServiceReference ref) {
-        modifications = modifications + 1;
-    }
-
-    public Map getObservations() {
-        Map map = new HashMap();
-        map.put("list", list);
-        map.put("modifications", new Integer(modifications));
-        map.put("validate", new Long(validate_time));
-        map.put("invalidate", new Long(invalidate_time));
-        map.put("arrival", new Long(first_arrival_time));
-        map.put("departure", new Long(first_departure_time));
-        return map;
-    }
-
-    public void start() {
-    	if (validate_time == 0) {
-    		validate_time = System.currentTimeMillis();
-    		try {
-				Thread.sleep(10);
-			} catch (InterruptedException e) {	}
-    	}
-    }
-
-    public void stop() {
-    	if (invalidate_time == 0) {
-    		invalidate_time = System.currentTimeMillis();
-    		try {
-				Thread.sleep(10);
-			} catch (InterruptedException e) {	}
-    	}
-    }
-
-
-}
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/Observable.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/Observable.java
deleted file mode 100644
index 94d7787..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/Observable.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.apache.felix.ipojo.test;
-
-import java.util.Map;
-
-public interface Observable {
-    
-    public Map getObservations();
-
-}
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/WbpTests.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/WbpTests.java
deleted file mode 100644
index 0206900..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/WbpTests.java
+++ /dev/null
@@ -1,281 +0,0 @@
-package org.apache.felix.ipojo.test;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.MissingHandlerException;
-import org.apache.felix.ipojo.UnacceptableConfiguration;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.util.Utils;
-import org.osgi.framework.ServiceReference;
-
-public class WbpTests extends OSGiTestCase {
-
-    Factory provFactory;
-    Factory factory, factory2, factory3, factory4;
-
-    public void setUp() {
-        provFactory = Utils.getFactoryByName(context, "fooprovider");
-        factory = Utils.getFactoryByName(context, "under-providers");
-        factory2 = Utils.getFactoryByName(context, "under-properties");
-        factory3 = Utils.getFactoryByName(context, "under-providers-lifecycle");
-        factory4 = Utils.getFactoryByName(context, "under-providers-2");
-    }
-
-    public void tearDown() {
-
-    }
-
-    public void testServiceProviders() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        ComponentInstance ci = factory.createComponentInstance(new Properties());
-
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
-        assertNotNull("Check Observable availability", ref);
-        Observable obs = (Observable) context.getService(ref);
-
-        Map map = obs.getObservations();
-        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
-
-        Properties p1 = new Properties();
-        p1.put("foo", "foo");
-        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-
-        Properties p2 = new Properties();
-        p2.put("foo", "foo");
-        ComponentInstance prov2 = provFactory.createComponentInstance(p2);
-
-        map = obs.getObservations();
-        assertEquals("Check list #2" , ((List) map.get("list")).size(), 2);
-
-        prov1.stop();
-
-        map = obs.getObservations();
-        assertEquals("(1) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov2.stop();
-
-        map = obs.getObservations();
-        assertEquals("(2) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        prov2.start();
-
-        map = obs.getObservations();
-        assertEquals("(3) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov1.start();
-
-        map = obs.getObservations();
-        assertEquals("(4) Check list #2" , ((List) map.get("list")).size(), 2);
-
-        prov1.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(5) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov2.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(6) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        context.ungetService(ref);
-        ci.dispose();
-    }
-
-    public void testPropertiesProviders() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        ComponentInstance ci = factory2.createComponentInstance(new Properties());
-
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
-        assertNotNull("Check Observable availability", ref);
-        Observable obs = (Observable) context.getService(ref);
-
-        Map map = obs.getObservations();
-        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
-
-        Properties p1 = new Properties();
-        p1.put("foo", "foo");
-        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
-        ServiceReference ref1 = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov1.getInstanceName());
-        FooService fs1 = (FooService) context.getService(ref1);
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-
-        Properties p2 = new Properties();
-        p2.put("foo", "foo");
-        ComponentInstance prov2 = provFactory.createComponentInstance(p2);
-        ServiceReference ref2 = Utils.getServiceReferenceByName(context, FooService.class.getName(), prov2.getInstanceName());
-        FooService fs2 = (FooService) context.getService(ref2);
-
-        map = obs.getObservations();
-        assertEquals("Check list #2" , ((List) map.get("list")).size(), 2);
-
-        fs1.foo();
-
-        map = obs.getObservations();
-        assertEquals("(1) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        fs2.foo();
-
-        map = obs.getObservations();
-        assertEquals("(2) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        fs2.foo();
-
-        map = obs.getObservations();
-        assertEquals("(3) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        fs1.foo();
-
-        map = obs.getObservations();
-        assertEquals("(4) Check list #2" , ((List) map.get("list")).size(), 2);
-
-        prov1.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(5) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov2.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(6) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        context.ungetService(ref1);
-        context.ungetService(ref2);
-        context.ungetService(ref);
-        ci.dispose();
-    }
-
-    public void testModifications() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        ComponentInstance ci = factory.createComponentInstance(new Properties());
-
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
-        assertNotNull("Check Observable availability", ref);
-        Observable obs = (Observable) context.getService(ref);
-
-        Map map = obs.getObservations();
-        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
-
-        Properties p1 = new Properties();
-        p1.put("foo", "foo");
-        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-        assertEquals("Check modification #0" , ((Integer) map.get("modifications")).intValue(), 0);
-
-        ServiceReference ref2 = Utils.getServiceReference(context, FooService.class.getName(), null);
-        assertNotNull("Check FooService availability", ref2);
-
-        FooService fs = (FooService) context.getService(ref2);
-        fs.foo();
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-        assertEquals("Check modification #1 (" + map.get("modifications")+")" , ((Integer) map.get("modifications")).intValue(), 1);
-
-        fs.foo();
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-        assertEquals("Check modification #2" , ((Integer) map.get("modifications")).intValue(), 2);
-
-        prov1.dispose();
-        map = obs.getObservations();
-        assertEquals("Check list #0" , ((List) map.get("list")).size(), 0);
-        assertEquals("Check modification #2" , ((Integer) map.get("modifications")).intValue(), 2);
-
-        context.ungetService(ref);
-        context.ungetService(ref2);
-        ci.dispose();
-    }
-
-    public void testLifecycleCompliance() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-    	// First expose a service.
-    	Properties p1 = new Properties();
-        p1.put("foo", "foo");
-        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
-
-        ComponentInstance ci = factory3.createComponentInstance(new Properties());
-
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
-        assertNotNull("Check Observable availability", ref);
-        Observable obs = (Observable) context.getService(ref);
-
-        Map map = obs.getObservations();
-        // Check time
-        Long validate = (Long) map.get("validate");
-        Long arrival = (Long) map.get("arrival");
-
-        // Validate must be call before.
-        assertTrue(validate.longValue() + " <?> " + arrival.longValue(), validate.longValue() < arrival.longValue());
-
-        prov1.dispose();
-        ci.dispose();
-
-    }
-
-    public void testServiceProvidersWhiteWhiteboards() throws UnacceptableConfiguration, MissingHandlerException, ConfigurationException {
-        ComponentInstance ci = factory4.createComponentInstance(new Properties());
-
-        ServiceReference ref = Utils.getServiceReferenceByName(context, Observable.class.getName(), ci.getInstanceName());
-        assertNotNull("Check Observable availability", ref);
-        Observable obs = (Observable) context.getService(ref);
-
-        Map map = obs.getObservations();
-        assertEquals("Check empty list" , ((List) map.get("list")).size(), 0);
-
-        Properties p1 = new Properties();
-        p1.put("foo", "foo");
-        ComponentInstance prov1 = provFactory.createComponentInstance(p1);
-
-        map = obs.getObservations();
-        assertEquals("Check list #1" , ((List) map.get("list")).size(), 1);
-
-        Properties p2 = new Properties();
-        p2.put("foo", "foo");
-        ComponentInstance prov2 = provFactory.createComponentInstance(p2);
-
-        map = obs.getObservations();
-        assertEquals("Check list #2" , ((List) map.get("list")).size(), 2);
-
-        prov1.stop();
-
-        map = obs.getObservations();
-        assertEquals("(1) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov2.stop();
-
-        map = obs.getObservations();
-        assertEquals("(2) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        prov2.start();
-
-        map = obs.getObservations();
-        assertEquals("(3) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov1.start();
-
-        map = obs.getObservations();
-        assertEquals("(4) Check list #2" , ((List) map.get("list")).size(), 2);
-
-        prov1.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(5) Check list #1" , ((List) map.get("list")).size(), 1);
-
-        prov2.dispose();
-
-        map = obs.getObservations();
-        assertEquals("(6) Check list #0" , ((List) map.get("list")).size(), 0);
-
-        context.ungetService(ref);
-        ci.dispose();
-    }
-}
diff --git a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index d2239d9..0000000
--- a/ipojo/tests/handler/whiteboard/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,261 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-}
diff --git a/ipojo/tests/integration-tests/pom.xml b/ipojo/tests/integration-tests/pom.xml
deleted file mode 100644
index 3c01ba9..0000000
--- a/ipojo/tests/integration-tests/pom.xml
+++ /dev/null
@@ -1,282 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>org.apache.felix.ipojo.integration-tests</artifactId>
-    <name>iPOJO Integration Tests</name>
-    <version>1.5.0-SNAPSHOT</version>
-
-    <parent>
-        <groupId>ipojo.tests</groupId>
-        <artifactId>ipojo.tests</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>maven-junit4osgi-plugin
-        </artifactId>
-                <version>1.1.0-SNAPSHOT</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>test</goal>
-                        </goals>
-                        <configuration>
-                            <hideOutputs>true</hideOutputs>
-                            <logService>false</logService>
-                            <configuration>
-                                <org.osgi.http.port>8083</org.osgi.http.port>
-                            </configuration>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-    <reporting>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-surefire-report-plugin</artifactId>
-                <version>2.4.3</version>
-                <configuration>
-                    <showSucess>true</showSucess>
-                    <reportsDirectories>
-                        <param>target/junit4osgi-reports</param>
-                    </reportsDirectories>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.codehaus.mojo</groupId>
-                <artifactId>cobertura-maven-plugin</artifactId>
-            </plugin>
-        </plugins>
-    </reporting>
-
-    <dependencies>
-        <!-- Manipulation -->
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.manipulation.metadata</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.manipulation</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.manipulation.primitives</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.manipulation.creation</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.manipulation.java5</artifactId>
-            <version>${ipojo.manipulator.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- Core -->
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.annotations</artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.bad.configurations
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.configuration
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.external.handlers
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.factories</artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.lifecycle.callback
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.lifecycle.controller
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.ps</artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.lifecycle.controller
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.service.dependency
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.service.dependency.bindingpolicy
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.service.dependency.comparator
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.core.service.dependency.filter
-      </artifactId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <artifactId>tests.core.ps.strategy</artifactId>
-            <groupId>ipojo.tests</groupId>
-            <version>${ipojo.core.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-
-
-        <!-- Composite -->
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.composite </artifactId>
-            <version>${ipojo.composite.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.composite.service.import-export</artifactId>
-            <version>${ipojo.composite.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.composite.service.instance</artifactId>
-            <version>${ipojo.composite.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.composite.service.providing</artifactId>
-            <version>${ipojo.composite.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <!-- External handlers -->
-
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.eventadmin.handler</artifactId>
-            <version>${ipojo.eah.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.temporal </artifactId>
-            <version>${ipojo.temporal.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>ipojo.tests</groupId>
-            <artifactId>tests.whiteboard </artifactId>
-            <version>${ipojo.wbp.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <!-- Utility bundles -->
-
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.handler.whiteboard</artifactId>
-            <version>${ipojo.wbp.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.handler.temporal</artifactId>
-            <version>${ipojo.temporal.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.handler.eventadmin</artifactId>
-            <version>${ipojo.eah.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.eventadmin</artifactId>
-            <version>1.2.2</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.composite</artifactId>
-            <version>${ipojo.composite.snapshot}</version>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.configadmin</artifactId>
-            <version>1.2.8</version>
-            <scope>test</scope>
-        </dependency>
-        <dependency>
-             <groupId>ipojo.tests</groupId>
-             <artifactId>tests.core.configadmin</artifactId>
-             <version>${ipojo.core.snapshot}</version>
-             <scope>test</scope>
-         </dependency>
-    </dependencies>
-</project>
diff --git a/ipojo/tests/manipulator/creation/pom.xml b/ipojo/tests/manipulator/creation/pom.xml
deleted file mode 100644
index 455fee8..0000000
--- a/ipojo/tests/manipulator/creation/pom.xml
+++ /dev/null
@@ -1,129 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Creation Manipulation Test Suite</name>
-  <artifactId>tests.manipulation.creation</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.manipulator.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.manipulation.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-              <configuration>
-              <org.osgi.http.port>8083</org.osgi.http.port>
-              </configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ASimpleParentClass.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ASimpleParentClass.java
deleted file mode 100644
index ef42322..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ASimpleParentClass.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ASimpleParentClass {
-    
-    protected String name;
-    
-    public ASimpleParentClass() {
-        name = "hello";
-    }
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
deleted file mode 100644
index 40c5a6a..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructor.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class CallSuperConstructor extends ParentClass {
-    
-    public CallSuperConstructor() {
-        super("test");
-        System.out.println("plop");
-    } 
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithBC.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithBC.java
deleted file mode 100644
index b8335aa..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithBC.java
+++ /dev/null
@@ -1,13 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.osgi.framework.BundleContext;
-
-public class CallSuperConstructorWithBC extends ParentClassWithBC {
-    
-    public CallSuperConstructorWithBC(BundleContext bc) {
-        super("bc", bc, "bundle");
-        String message = "plop-bc";
-        System.out.println(message);
-    } 
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithNew.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithNew.java
deleted file mode 100644
index e147d09..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperConstructorWithNew.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class CallSuperConstructorWithNew extends ParentClass {
-    
-    public CallSuperConstructorWithNew() {
-        super(new StringBuffer("test"));
-        System.out.println("plop");
-    } 
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperSuperConstructorWithNew.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperSuperConstructorWithNew.java
deleted file mode 100644
index 6f0892f..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/CallSuperSuperConstructorWithNew.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class CallSuperSuperConstructorWithNew extends ParentClass2 {
-
-    public CallSuperSuperConstructorWithNew() {
-        super(new String("test"));
-        System.out.println("plop");
-    }
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 7fea38d..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructor.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructor.java
deleted file mode 100644
index 59f2ef7..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructor.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-
-public class NoEmptyConstructor implements CheckService {
-    
-   
-        private String name;
-
-        public NoEmptyConstructor(final String n) {
-            name = n;
-        }
-
-        public boolean check() {
-            return name != null;
-        }
-
-        public Properties getProps() {
-            Properties props = new Properties();
-            if (name == null) {
-                props.put("name", "NULL");
-            } else {
-                props.put("name", name);
-            }
-            return props;
-        }
-
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructorWithParentClass.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructorWithParentClass.java
deleted file mode 100644
index 409692b..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/NoEmptyConstructorWithParentClass.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-
-public class NoEmptyConstructorWithParentClass extends ASimpleParentClass implements CheckService  {
-    
-        public NoEmptyConstructorWithParentClass(final String n) {
-            name = n;
-        }
-
-        public boolean check() {
-            return name != null;
-        }
-
-        public Properties getProps() {
-            Properties props = new Properties();
-            if (name == null) {
-                props.put("name", "NULL");
-            } else {
-                props.put("name", name);
-            }
-            return props;
-        }
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
deleted file mode 100644
index 5b6b99f..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass {
-    
-    private String name;
-
-    public ParentClass(final String n) {
-        name = n;
-    }
-    
-    public ParentClass(final StringBuffer n) {
-        name = n.toString();
-    } 
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass2.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass2.java
deleted file mode 100644
index 39bea4e..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClass2.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class ParentClass2 extends SuperParentClass {
-
-    public ParentClass2(String n) {
-        super(n);
-    }
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClassWithBC.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClassWithBC.java
deleted file mode 100644
index 8902d43..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/ParentClassWithBC.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.osgi.framework.BundleContext;
-
-public class ParentClassWithBC {
-    
-    private BundleContext bc;
-
-    public ParentClassWithBC(String foo, BundleContext bc, String bar) {
-        this.bc = bc;
-        System.out.println(foo + " : " + this.bc + "(" + bar + ")");
-    } 
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SeveralConstructors.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SeveralConstructors.java
deleted file mode 100644
index b31278a..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SeveralConstructors.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-
-public class SeveralConstructors implements CheckService {
-    
-   
-        private String name;
-
-        public SeveralConstructors(){
-            this("hello world");
-        }
-
-        public SeveralConstructors(final String n) {
-            name = n;
-        }
-
-        public boolean check() {
-            return name != null;
-        }
-
-        public Properties getProps() {
-            Properties props = new Properties();
-            props.put("name", name);
-            return props;
-        }
-
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SuperParentClass.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SuperParentClass.java
deleted file mode 100644
index 2b87f4a..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SuperParentClass.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class SuperParentClass {
-
-    private String name;
-
-    public SuperParentClass(final String n) {
-        System.out.println("Hello from super super !");
-        name = n;
-    }
-
-    public SuperParentClass(final StringBuffer n) {
-        name = n.toString();
-    }
-
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
deleted file mode 100644
index 11db1fa..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ManipulationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Manipulation Creation Test Suite", bc);
-        ots.addTestSuite(POJOCreation.class);
-        ots.addTestSuite(SeveralConstructorTest.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
deleted file mode 100644
index bd30524..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/POJOCreation.java
+++ /dev/null
@@ -1,262 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Check the different method to create POJO object.
- */
-public class POJOCreation extends OSGiTestCase {
-
-    private IPOJOHelper helper;
-
-    private ComponentInstance ci_lazzy;
-    private ComponentInstance ci_immediate;
-    private ComponentInstance ci_immediate_singleton;
-
-    private Architecture lazzyArch;
-    private Architecture immeArch;
-    private Architecture immeArchSing;
-
-
-    private ComponentInstance ci_lazzy_sing;
-    private ComponentInstance ci_lazzy_sev;
-
-    private Architecture lazzyArchSing;
-    private Architecture lazzyArchSev;
-    private ComponentInstance ci_lazzy_singM;
-    private ComponentInstance ci_lazzy_sevM;
-
-    private Architecture lazzyArchSingM;
-    private Architecture lazzyArchSevM;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-
-        String factName = "ManipulationCreation-FooProviderType-1";
-        String compName = "FooProvider-1";
-        ci_lazzy = helper.createComponentInstance(factName ,compName);
-
-        String factName2 = "ManipulationCreation-ImmediateFooProviderType";
-        String compName2 = "FooProvider-2";
-        ci_immediate = helper.createComponentInstance(factName2, compName2);
-
-        String factName3 = "ManipulationCreation-ImmediateFooProviderTypeSingleton";
-        String compName3 = "FooProvider-3";
-        ci_immediate_singleton = helper.createComponentInstance(factName3, compName3);
-
-        String factName4 = "ManipulationCreation-FooProviderType-1-Sing";
-        String compName4 = "FooProvider-1-Sing";
-        ci_lazzy_sing = helper.createComponentInstance(factName4, compName4);
-
-        String factName5 = "ManipulationCreation-FooProviderType-1-Sev";
-        String compName5 = "FooProvider-1-Sev";
-        ci_lazzy_sev = helper.createComponentInstance(factName5, compName5);
-
-        String factName6 = "ManipulationCreation-FooProviderType-1-SingM";
-        String compName6 = "FooProvider-1-SingM";
-        ci_lazzy_singM = helper.createComponentInstance(factName6, compName6);
-
-        String factName7 = "ManipulationCreation-FooProviderType-1-SevM";
-        String compName7 = "FooProvider-1-SevM";
-        ci_lazzy_sevM = helper.createComponentInstance(factName7, compName7);
-
-        lazzyArch = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName+")");
-        immeArch =   (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName2+")");
-        immeArchSing = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName3+")");
-        lazzyArchSing = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName4+")");
-        lazzyArchSev = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName5+")");
-        lazzyArchSingM = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName6+")");
-        lazzyArchSevM = (Architecture) getServiceObject(Architecture.class.getName(), "(architecture.instance="+compName7+")");
-    }
-
-    public void tearDown() {
-        lazzyArch = null;
-        immeArch = null;
-        immeArchSing = null;
-        lazzyArchSing = null;
-        lazzyArchSev = null;
-        lazzyArchSingM = null;
-        lazzyArchSevM = null;
-        helper.dispose();
-    }
-
-    /**
-     * Check lazy creation.
-     */
-    public void testLazyCreation() {
-        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check lazy and singleton creation.
-     */
-    public void testLazyCreationSingleton() {
-        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sing.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy_sing.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object",1,  ((PrimitiveInstanceDescription) lazzyArchSing.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check lazy and "several" creation.
-     */
-    public void testLazyCreationSeveral() {
-        assertEquals("Check that no objects are created ", 0,  ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sev.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy_sev.getInstanceName() + " is available", ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        FooService fs2 = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertTrue("Check the FooService invocation-2", fs2.foo());
-        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSev.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check immediate creation.
-     */
-    public void testImmediateCreation() {
-        assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_immediate.getInstanceName() + " is available", ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArch.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check bundle context injection.
-     */
-    public void testBundleContext() {
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        Properties p = fs.fooProps();
-        assertNotNull("Check the bundle context", p.get("context"));
-        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArch.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Test immediate singleton creation.
-     */
-    public void testImmediateSingletonCreation() {
-        assertEquals("Check that one object is created ", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_immediate_singleton.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_immediate_singleton.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object", 1, ((PrimitiveInstanceDescription) immeArchSing.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check creation through a factory method.
-     * (lazy & singleton creation)
-     */
-    public void testLazyCreationSingletonM() {
-        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_singM.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy_singM.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        FooService fs2 = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertTrue("Check the FooService invocation", fs2.foo());
-        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSingM.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Check creation through a factory method.
-     * (lazy & several creation)
-     */
-    public void testLazyCreationSeveralM() {
-        assertEquals("Check that no objects are created ", 0, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
-        ServiceReference ref= helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy_sevM.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy_sevM.getInstanceName() + " is available",ref);
-        FooService fs = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation", fs.foo());
-        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
-        FooService fs2 = (FooService) getServiceObject(ref);
-        assertTrue("Check the FooService invocation-2", fs2.foo());
-        // Only one object as the getService method is called only once (service factory) despite the policy="method".
-        assertEquals("Check the creation of 1 object",1, ((PrimitiveInstanceDescription) lazzyArchSevM.getInstanceDescription()).getCreatedObjects().length);
-    }
-
-    /**
-     * Test a custom constructor.
-     * Not manipulated.
-     */
-    public void testCustomConstuctor() {
-        FooService fs = new FooProviderType1(0, "foo", getContext());
-        Properties props = fs.fooProps();
-        assertEquals("Check bar", 0, ((Integer) props.get("bar")).intValue());
-        assertEquals("Check foo", "foo", props.get("foo"));
-        assertEquals("Check context", getContext(), props.get("context"));
-    }
-
-    public void testSuperCall() {
-        try {
-            helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructor");
-        } catch (Throwable e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testSuperCallWithNew() {
-        try {
-            helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructorWithNew");
-        } catch (Throwable e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testSuperSuperCallWithNew() {
-        try {
-            helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.CallSuperSuperConstructorWithNew");
-        } catch (Throwable e) {
-            fail(e.getMessage());
-        }
-    }
-
-    public void testSuperCallWithBC() {
-        try {
-            helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructorWithBC");
-        } catch (Throwable e) {
-            fail(e.getMessage());
-        }
-    }
-
-
-
-}
\ No newline at end of file
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/SeveralConstructorTest.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/SeveralConstructorTest.java
deleted file mode 100644
index f2c8ddf..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/SeveralConstructorTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-import org.osgi.framework.ServiceReference;
-
-import org.apache.felix.ipojo.ComponentInstance;
-
-public class SeveralConstructorTest extends OSGiTestCase {
-    
-    private IPOJOHelper helper;
-    
-    private ComponentInstance ci, ci2, ci3;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        ci = helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.SeveralConstructors");
-        ci2 = helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.NoEmptyConstructor");
-        ci3 = helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.NoEmptyConstructorWithParentClass");
-
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-
-    
-    public void testSeveralConstructor() {
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), ci.getInstanceName());
-        CheckService cs = (CheckService) getServiceObject(ref);
-        assertTrue("Check assignation", cs.check());
-        String name = (String) cs.getProps().get("name");
-        assertEquals("Check message", "hello world", name);
-        //assertNull("Check message", name);
-    }
-    
-    public void testNoEmptyConstructor() {
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), ci2.getInstanceName());
-        CheckService cs = (CheckService) getServiceObject(ref);
-        assertFalse("Check assignation", cs.check());
-        String name = (String) cs.getProps().get("name");
-        assertEquals("Check message", "NULL", name);
-    }
-    
-    public void testNoEmptyConstructorWithAParentClass() {
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), ci3.getInstanceName());
-        CheckService cs = (CheckService) getServiceObject(ref);
-        assertTrue("Check assignation", cs.check()); // super set name to "hello"
-        String name = (String) cs.getProps().get("name");
-        assertEquals("Check message", "hello", name);
-    }
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
deleted file mode 100644
index 5f5b74b..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service.A123;
-
-public interface CheckService2 {
-	
-	public boolean check();
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
deleted file mode 100644
index dfe2b9c..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
deleted file mode 100644
index ef7e1ee..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
deleted file mode 100644
index f1e8dc0..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
deleted file mode 100644
index 1bb177c..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface Plop {
-    
-   Object getPlop();
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java b/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
deleted file mode 100644
index cd61e3b..0000000
--- a/ipojo/tests/manipulator/creation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface PrimitiveManipulationTestService {
-	
-	byte getByte();
-	void setByte(byte b);
-	
-	short getShort();
-	void setShort(short s);
-	
-	int getInt();
-	void setInt(int i);
-	
-	long getLong();
-	void setLong(long l);
-	
-	float getFloat();
-	void setFloat(float f);
-	
-	double getDouble();
-	void setDouble(double d);
-	
-	char getChar();
-	void setChar(char c);
-	
-	boolean getBoolean();
-	void setBoolean(boolean b);
-	
-	// Array types
-	byte[] getBytes();
-	void setBytes(byte[] bs);
-	
-	short[] getShorts();
-	void setShorts(short[] ss);
-	
-	int[] getInts();
-	void setInts(int is[]);
-	
-	long[] getLongs();
-	void setLongs(long[] ls);
-	
-	float[] getFloats();
-	void setFloats(float[] fs);
-	
-	double[] getDoubles();
-	void setDoubles(double[] ds);
-	
-	char[] getChars();
-	void setChars(char[] cs);
-	
-	boolean[] getBooleans();
-	void setBooleans(boolean[] bs);	
-	
-	// This method has been added to test an issue when autoboxing.
-	void setLong(long l, String s);
-
-}
diff --git a/ipojo/tests/manipulator/creation/src/main/resources/metadata.xml b/ipojo/tests/manipulator/creation/src/main/resources/metadata.xml
deleted file mode 100644
index c8cd937..0000000
--- a/ipojo/tests/manipulator/creation/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,75 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-  <!-- Simple provider  used for manipulation analysis -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-FooProviderType-1" architecture="true">
-    <provides />
-  </component>
-
-  <!-- Non lazzy service provider, to check instantiation -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-ImmediateFooProviderType" immediate="true"
-    architecture="true">
-    <provides />
-  </component>
-
-  <!-- Type checking different creation policy -->
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-FooProviderType-1-Sing" factory-method="singleton"
-    architecture="true">
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-FooProviderType-1-Sev" factory-method="several"
-    architecture="true">
-    <provides />
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-FooProviderType-1-SingM" factory-method="singleton"
-    architecture="true">
-    <provides/>
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-FooProviderType-1-SevM" factory-method="several"
-    architecture="true">
-    <provides/>
-  </component>
-
-  <component
-    classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-    name="ManipulationCreation-ImmediateFooProviderTypeSingleton" immediate="true"
-    factory-method="singleton" architecture="true">
-    <provides />
-  </component>
-
-
-  <!-- Try calling super constructors -->
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructor" immediate="true"/>
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructorWithNew" immediate="true"/>
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.CallSuperConstructorWithBC" immediate="true"/>
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.CallSuperSuperConstructorWithNew" immediate="true"/>
-
-   <!--  Several constructors -->
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.SeveralConstructors">
-     <provides/>
-   </component>
-   <!--  No Empty constructor -->
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.NoEmptyConstructor">
-     <provides/>
-   </component>
-   <component classname="org.apache.felix.ipojo.test.scenarios.component.NoEmptyConstructorWithParentClass">
-     <provides/>
-   </component>
-</ipojo>
diff --git a/ipojo/tests/manipulator/manipulation/pom.xml b/ipojo/tests/manipulator/manipulation/pom.xml
deleted file mode 100644
index df6095a..0000000
--- a/ipojo/tests/manipulator/manipulation/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Manipulation Test Suite</name>
-  <artifactId>tests.manipulation</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.manipulator.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.manipulation.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/manipulator/manipulation/src/main/ipojo/metadata.xml b/ipojo/tests/manipulator/manipulation/src/main/ipojo/metadata.xml
deleted file mode 100644
index b3e0262..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/ipojo/metadata.xml
+++ /dev/null
@@ -1,37 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-	<!-- Simple provider  used for manipulation analysis -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Manipulation-FooProviderType-1" architecture="true">
-		<provides />
-	</component>
-	
-	<!-- Non lazzy service provider, to check instantiation -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="Manipulation-ImmediateFooProviderType" immediate="true"
-		architecture="true">
-		<provides />
-	</component>
-	
-	<!-- Nested & Inner classes -->
-	<component name="inners" classname="org.apache.felix.ipojo.test.scenarios.component.InnerClasses">
-		<provides>
-			<property field="privateObject"/>
-			<property field="privateInt"/>
-			
-			<property field="protectedObject"/>
-			<property field="protectedInt"/>
-			
-			<property field="packageObject"/>
-			<property field="packageInt"/>
-			
-			<property field="publicObject"/>
-			<property field="publicInt"/>
-		</provides>
-	</component>
-</ipojo>
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 7fea38d..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InnerClasses.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InnerClasses.java
deleted file mode 100644
index 4bee70e..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/component/InnerClasses.java
+++ /dev/null
@@ -1,168 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-
-public class InnerClasses implements CheckService {
-    
-    private String privateObject;
-    private int privateInt;
-    
-    protected String protectedObject;
-    protected int protectedInt;
-    
-    String packageObject;
-    int packageInt;
-    
-    public String publicObject;
-    public int publicInt;
-    
-    private String nonObject = "not-managed";
-    private int nonInt = 5;
-    
-    private static int staticint = 6;
-
-    public boolean check() {
-        return true;
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("publicInner", new PublicNested().doSomething());
-        props.put("packageInner", new PackageNested().doSomething());
-        props.put("protectedInner", new ProtectedNested().doSomething());
-        props.put("privateInner", new PrivateNested().doSomething());
-        props.put("constructorInner", new ConstructorNested().doSomething());
-        props.put("staticInner", new StaticNested().doSomething());
-        
-        Job anonymous = new Job()  {
-            public Map doSomething() {
-                Map map = new HashMap();
-                map.put("publicObject", publicObject);
-                map.put("publicInt", new Integer(publicInt));
-                map.put("packageObject", packageObject);
-                map.put("packageInt", new Integer(packageInt));
-                map.put("protectedObject", protectedObject);
-                map.put("protectedInt", new Integer(protectedInt));
-                map.put("privateObject", privateObject);
-                map.put("privateInt", new Integer(privateInt));
-                map.put("nonObject", nonObject);
-                map.put("nonInt", new Integer(nonInt));
-                return map;
-            }
-        };
-        
-        props.put("anonymous", anonymous.doSomething());
-        props.put("public", new PublicNested());
-        
-        
-        return props;
-    }
-    
-    private class PrivateNested implements Job {
-        public Map doSomething() {
-            Map map = new HashMap();
-            map.put("publicObject", publicObject);
-            map.put("publicInt", new Integer(publicInt));
-            map.put("packageObject", packageObject);
-            map.put("packageInt", new Integer(packageInt));
-            map.put("protectedObject", protectedObject);
-            map.put("protectedInt", new Integer(protectedInt));
-            map.put("privateObject", privateObject);
-            map.put("privateInt", new Integer(privateInt));
-            map.put("nonObject", nonObject);
-            map.put("nonInt", new Integer(nonInt));
-            return map;
-        }
-    }
-    
-    public class PublicNested implements Job {
-        public Map doSomething() {
-            Map map = new HashMap();
-            map.put("publicObject", publicObject);
-            map.put("publicInt", new Integer(publicInt));
-            map.put("packageObject", packageObject);
-            map.put("packageInt", new Integer(packageInt));
-            map.put("protectedObject", protectedObject);
-            map.put("protectedInt", new Integer(protectedInt));
-            map.put("privateObject", privateObject);
-            map.put("privateInt", new Integer(privateInt));
-            map.put("nonObject", nonObject);
-            map.put("nonInt", new Integer(nonInt));
-            return map;
-        }
-    }
-    
-    class PackageNested implements Job {
-        public Map doSomething() {
-            Map map = new HashMap();
-            map.put("publicObject", publicObject);
-            map.put("publicInt", new Integer(publicInt));
-            map.put("packageObject", packageObject);
-            map.put("packageInt", new Integer(packageInt));
-            map.put("protectedObject", protectedObject);
-            map.put("protectedInt", new Integer(protectedInt));
-            map.put("privateObject", privateObject);
-            map.put("privateInt", new Integer(privateInt));
-            map.put("nonObject", nonObject);
-            map.put("nonInt", new Integer(nonInt));
-            return map;
-        }
-    }
-    
-    protected class ProtectedNested implements Job {
-        public Map doSomething() {
-            Map map = new HashMap();
-            map.put("publicObject", publicObject);
-            map.put("publicInt", new Integer(publicInt));
-            map.put("packageObject", packageObject);
-            map.put("packageInt", new Integer(packageInt));
-            map.put("protectedObject", protectedObject);
-            map.put("protectedInt", new Integer(protectedInt));
-            map.put("privateObject", privateObject);
-            map.put("privateInt", new Integer(privateInt));
-            map.put("nonObject", nonObject);
-            map.put("nonInt", new Integer(nonInt));
-            return map;
-        }
-    }
-    
-    protected static class StaticNested implements Job {
-        private Map map = new HashMap();
-        
-        public Map doSomething() {
-            map.put("static", new Boolean(true));
-            map.put("staticint", new Integer(staticint));
-            return map;
-        }
-    }
-    
-    protected class ConstructorNested implements Job {
-        Map map = new HashMap();
-        public ConstructorNested() {
-            map.put("publicObject", publicObject);
-            map.put("publicInt", new Integer(publicInt));
-            map.put("packageObject", packageObject);
-            map.put("packageInt", new Integer(packageInt));
-            map.put("protectedObject", protectedObject);
-            map.put("protectedInt", new Integer(protectedInt));
-            map.put("privateObject", privateObject);
-            map.put("privateInt", new Integer(privateInt));
-            map.put("nonObject", nonObject);
-            map.put("nonInt", new Integer(nonInt));
-        }
-        
-        public Map doSomething() {
-            return map;
-        }
-    }
-    
-
-}
-
-interface Job {
-    public Map doSomething();
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
deleted file mode 100644
index a0761e0..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ExceptionTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.FooProviderType1;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Test exception handling. POJO exception must be propagated.
- */
-public class ExceptionTest extends OSGiTestCase {
-	
-	private ComponentInstance ci_lazzy;
-	
-	private ServiceReference lazzyRef;
-	private ServiceReference immRef;	
-	
-	IPOJOHelper helper;
-
-	public void setUp() {
-	    helper = new IPOJOHelper(this);
-	    
-		String factName = "Manipulation-FooProviderType-1";
-		String compName = "FooProvider-1";
-		ci_lazzy = helper.createComponentInstance(factName, compName);
-		
-		String factName2 = "Manipulation-ImmediateFooProviderType";
-		String compName2 = "FooProvider-2";
-		helper.createComponentInstance(factName2, compName2);
-		
-		lazzyRef = getServiceReference(Architecture.class.getName(), "(architecture.instance="+compName+")");
-		immRef =   getServiceReference(Architecture.class.getName(), "(architecture.instance="+compName2+")");
-		
-		assertNotNull("LazzyRef", lazzyRef);
-		assertNotNull("ImmRef", immRef);
-	}
-	
-	public void tearDown() {
-	    helper.dispose();
-	}
-	
-    
-    /**
-     * Check that the exception is correctly propagated.
-     */
-    public void testException() {
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
-        FooProviderType1 fs = (FooProviderType1) getServiceObject(ref);
-        try {
-            fs.testException();
-            fail("The method must returns an exception");
-        } catch(Exception e) {
-            // OK
-        }
-    }
-    
-    /**
-     * Check that the exception is correctly catch by the POJO.
-     */
-    public void testTry() {
-        ServiceReference ref = helper.getServiceReferenceByName(FooService.class.getName(), ci_lazzy.getInstanceName());
-        assertNotNull("Check that a FooService from " + ci_lazzy.getInstanceName() + " is available",ref);
-        FooProviderType1 fs = (FooProviderType1) getServiceObject(ref);
-        try {
-            fs.testTry();
-        } catch(Exception e) {
-            fail("The method has returned an exception");
-        }
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
deleted file mode 100644
index 88144c0..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/GetComponentInstanceTest.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Pojo;
-import org.apache.felix.ipojo.PrimitiveInstanceDescription;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Check the getComponentInstance method on a POJO
- */
-public class GetComponentInstanceTest extends OSGiTestCase {
-    
-    IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-    
-	/**
-	 * Check if a pojo can correctly be cast in POJO.
-	 * Check the getComponentInstance method. 
-	 */
-	public void testGetComponentInstance() {
-		String factName = "Manipulation-FooProviderType-1";
-		String compName = "FooProvider-1";
-		ServiceReference ref = null;
-		
-		// Get the factory to create a component instance
-		Factory fact = helper.getFactory(factName);
-		assertNotNull("Cannot find the factory FooProvider-1", fact);
-		
-		Properties props = new Properties();
-		props.put("instance.name",compName);
-		ComponentInstance ci = null;
-		try {
-			ci = fact.createComponentInstance(props);
-		} catch (Exception e1) { fail(e1.getMessage()); }
-		
-		assertEquals("Check instance name", compName, ci.getInstanceName());
-		
-		// Get a FooService provider
-		ref = helper.getServiceReferenceByName(FooService.class.getName(),  compName);
-		
-		assertNotNull("FS not available", ref);
-		
-		// Get foo object
-		FooService fs = (FooService) getServiceObject(ref);
-		
-		// Cast to POJO
-		Pojo pojo = (Pojo) fs;
-		
-		// GetComponentInstance
-		ComponentInstance instance = pojo.getComponentInstance();
-		assertEquals("Check component instance name", instance.getInstanceName(), compName);
-		assertEquals("Check component factory name", instance.getFactory().getName(), factName);
-		assertNotNull("Instance description not null", instance.getInstanceDescription());
-		PrimitiveInstanceDescription id = (PrimitiveInstanceDescription) instance.getInstanceDescription();
-		assertTrue("Check instance state", id.getState() == ComponentInstance.VALID);
-		assertEquals("Check created pojo count", id.getCreatedObjects().length, 1);
-		assertEquals("Check instance description name", id.getName(), compName); 
-		
-		ci.dispose();
-		
-		// Check that there is no more FooService
-		ref = getServiceReference(FooService.class.getName());
-		assertNull("FS available, but component instance stopped", ref);
-	}
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
deleted file mode 100644
index fe91774..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ManipulationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Manipulation Test Suite", bc);
-		ots.addTestSuite(GetComponentInstanceTest.class);
-        ots.addTestSuite(ExceptionTest.class);
-        ots.addTestSuite(NestedClassesTests.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/NestedClassesTests.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/NestedClassesTests.java
deleted file mode 100644
index e076b6a..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/NestedClassesTests.java
+++ /dev/null
@@ -1,178 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.util.Map;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.component.InnerClasses;
-import org.apache.felix.ipojo.test.scenarios.component.InnerClasses.PublicNested;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-import org.osgi.framework.ServiceReference;
-
-public class NestedClassesTests extends OSGiTestCase {
-    
-    private ComponentInstance instance;
-    private CheckService service; 
-    
-    IPOJOHelper helper;
-    
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Properties map = new Properties();
-        map.put("publicObject", "publicObject");
-        map.put("publicInt", new Integer(0));
-        map.put("packageObject", "packageObject");
-        map.put("packageInt", new Integer(1));
-        map.put("protectedObject", "protectedObject");
-        map.put("protectedInt", new Integer(2));
-        map.put("privateObject", "privateObject");
-        map.put("privateInt", new Integer(3));
-        map.put("nonObject", "nonObject");
-        map.put("nonInt", new Integer(4));
-        instance = helper.createComponentInstance("inners", map);
-        
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check service availability", ref);
-        service = (CheckService) getServiceObject(ref);
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-        service = null;
-    }
-    
-    public void testPrivateInnerClass() {
-        Map data = (Map) service.getProps().get("privateInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testProtectedInnerClass() {
-        Map data = (Map) service.getProps().get("protectedInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testPackageInnerClass() {
-        Map data = (Map) service.getProps().get("packageInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testPublicInnerClass() {
-        Map data = (Map) service.getProps().get("publicInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testConstructorInnerClass() {
-        Map data = (Map) service.getProps().get("constructorInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testStaticInnerClass() {
-        Map data = (Map) service.getProps().get("staticInner");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check static", new Boolean(true), data.get("static"));
-        assertEquals("Check static int", new Integer(6), data.get("staticint"));
-    
-    }
-    
-    public void testAnonymousInnerClass() {
-        Map data = (Map) service.getProps().get("anonymous");
-        assertNotNull("Check data existency", data);
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-    
-    }
-    
-    public void testInnerAccess() {
-        Map map = (Map) service.getProps();
-        assertNotNull("Check map existency", map);
-        
-        InnerClasses.PublicNested p = (PublicNested) map.get("public");
-        Map data = p.doSomething();
-        
-        assertEquals("Check public object", "publicObject", data.get("publicObject"));
-        assertEquals("Check public int", new Integer(0), data.get("publicInt"));
-        assertEquals("Check protected object", "protectedObject", data.get("protectedObject"));
-        assertEquals("Check protected int", new Integer(2), data.get("protectedInt"));
-        assertEquals("Check package object", "packageObject", data.get("packageObject"));
-        assertEquals("Check package int", new Integer(1), data.get("packageInt"));
-        assertEquals("Check private object", "privateObject", data.get("privateObject"));
-        assertEquals("Check private int", new Integer(3), data.get("privateInt"));
-        assertEquals("Check non-managed object", "not-managed", data.get("nonObject"));
-        assertEquals("Check non-managed int", new Integer(5), data.get("nonInt"));
-        
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
deleted file mode 100644
index 5f5b74b..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service.A123;
-
-public interface CheckService2 {
-	
-	public boolean check();
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
deleted file mode 100644
index dfe2b9c..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
deleted file mode 100644
index ef7e1ee..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
deleted file mode 100644
index f1e8dc0..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
deleted file mode 100644
index 1bb177c..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface Plop {
-    
-   Object getPlop();
-
-}
diff --git a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java b/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
deleted file mode 100644
index cd61e3b..0000000
--- a/ipojo/tests/manipulator/manipulation/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface PrimitiveManipulationTestService {
-	
-	byte getByte();
-	void setByte(byte b);
-	
-	short getShort();
-	void setShort(short s);
-	
-	int getInt();
-	void setInt(int i);
-	
-	long getLong();
-	void setLong(long l);
-	
-	float getFloat();
-	void setFloat(float f);
-	
-	double getDouble();
-	void setDouble(double d);
-	
-	char getChar();
-	void setChar(char c);
-	
-	boolean getBoolean();
-	void setBoolean(boolean b);
-	
-	// Array types
-	byte[] getBytes();
-	void setBytes(byte[] bs);
-	
-	short[] getShorts();
-	void setShorts(short[] ss);
-	
-	int[] getInts();
-	void setInts(int is[]);
-	
-	long[] getLongs();
-	void setLongs(long[] ls);
-	
-	float[] getFloats();
-	void setFloats(float[] fs);
-	
-	double[] getDoubles();
-	void setDoubles(double[] ds);
-	
-	char[] getChars();
-	void setChars(char[] cs);
-	
-	boolean[] getBooleans();
-	void setBooleans(boolean[] bs);	
-	
-	// This method has been added to test an issue when autoboxing.
-	void setLong(long l, String s);
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/pom.xml b/ipojo/tests/manipulator/manipulator-java5/pom.xml
deleted file mode 100644
index 7c68ac9..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/pom.xml
+++ /dev/null
@@ -1,123 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Manipulation Test Suite For Java 5</name>
-  <artifactId>tests.manipulation.java5</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.manipulator.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.manipulation.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.5</source>
-          <target>1.5</target>
-        </configuration>
-      </plugin>
-
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-junit4osgi-plugin</artifactId>
-        <version>1.1.0-SNAPSHOT</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>test</goal>
-            </goals>
-            <configuration>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Annotation.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Annotation.java
deleted file mode 100644
index efdc265..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Annotation.java
+++ /dev/null
@@ -1,46 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-import org.apache.felix.ipojo.test.scenarios.component.Marker.Type;
-
-public class Annotation {
-    
-    @Marker(name="marker", type=Type.BAR, 
-            sub=@SubMarker(subname="foo"),
-            arrayOfObjects={"foo", "bar", "baz"},
-            arrayOfAnnotations= {@SubMarker(subname="foo")}
-    )
-    @SubMarker(subname="bar")
-    @Invisible
-    public void doSomething() {
-        System.out.println("Foo ...");
-    }
-    
-    @Marker(name="marker", type=Type.BAR, 
-            sub=@SubMarker(subname="foo"),
-            arrayOfObjects={"foo", "bar", "baz"},
-            arrayOfAnnotations= {@SubMarker(subname="foo")}
-    )
-    @SubMarker(subname="bar")
-    @Invisible
-    public Annotation() {
-        
-    }
-    
-    public void doSomethingWithParams(@Marker(name="marker", type=Type.BAR, 
-            sub=@SubMarker(subname="foo"),
-            arrayOfObjects={"foo", "bar", "baz"},
-            arrayOfAnnotations= {@SubMarker(subname="foo")}) String foo, 
-            @Invisible String bar, 
-            @bla @SubMarker(subname = "baz") String baz) {
-        System.out.println("Foo ...");
-    }
-    
-    @Retention(RetentionPolicy.RUNTIME)
-    @interface bla {
-        
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceImpl.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceImpl.java
deleted file mode 100644
index 83f050c..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooServiceImpl.java
+++ /dev/null
@@ -1,44 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-public class FooServiceImpl implements FooService {
-
-    public boolean foo() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public Properties fooProps() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-    public boolean getBoolean() {
-        // TODO Auto-generated method stub
-        return false;
-    }
-
-    public double getDouble() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public int getInt() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public long getLong() {
-        // TODO Auto-generated method stub
-        return 0;
-    }
-
-    public Boolean getObject() {
-        // TODO Auto-generated method stub
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Invisible.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Invisible.java
deleted file mode 100644
index 2026df9..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Invisible.java
+++ /dev/null
@@ -1,5 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public @interface Invisible {
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
deleted file mode 100644
index fb273c5..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-
-
-public class Manipulation23Tester implements PrimitiveManipulationTestService {
-	
-	// Integer types
-	byte b = 1;
-	short s = 1;
-	int i = 1;
-	long l = 1;
-	
-	// Floatting types
-	double d = 1.1;
-	float f = 1.1f;
-	
-	// Character
-	char c = 'a';
-	
-	// Boolean
-	boolean bool = false;
-	
-	// Integer arrays 
-	byte[] bs = new byte[] {0,1,2};
-	short[] ss = new short[] {0,1,2};
-	int[] is = new int[] {0,1,2};
-	long[] ls = new long[] {0,1,2};
-	
-	double[] ds = new double[] {0.0, 1.1, 2.2};
-	float[] fs = new float[] {0.0f, 1.1f, 2.2f};
-	
-	char[] cs = new char[] {'a', 'b', 'c'};
-	
-	boolean[] bools = new boolean[] {false, true, false};
-
-	public boolean getBoolean() { return bool; }
-
-	public boolean[] getBooleans() { return bools; }
-
-	public byte getByte() { return b; }
-
-	public byte[] getBytes() { return bs; }
-
-	public char getChar() { return c; }
-
-	public char[] getChars() { return cs; }
-
-	public double getDouble() { return d; }
-
-	public double[] getDoubles() { return ds; }
-
-	public float getFloat() { return f; }
-
-	public float[] getFloats() { return fs; }
-
-	public int getInt() { return i; }
-
-	public int[] getInts() { return is; }
-
-	public long getLong() { return l; }
-
-	public long[] getLongs() { return ls; }
-
-	public short getShort() { return s; }
-
-	public short[] getShorts() { return ss; }
-
-	public void setBoolean(boolean b) { this.bool = b; }
-
-	public void setBooleans(boolean[] bs) { this.bools = bs; }
-
-	public void setByte(byte b) { this.b = b; }
-
-	public void setBytes(byte[] bs) { this.bs = bs; }
-
-	public void setChar(char c) { this.c = c; }
-
-	public void setChars(char[] cs) { this.cs = cs; }
-
-	public void setDouble(double d) { this.d = d; }
-
-	public void setDoubles(double[] ds) { this.ds = ds; }
-
-	public void setFloat(float f) { this.f = f; }
-
-	public void setFloats(float[] fs) { this.fs = fs; }
-
-	public void setInt(int i) { this.i = i; }
-
-	public void setInts(int[] is) { this.is = is; }
-
-	public void setLong(long l) { this.l = l; }
-
-	public void setLongs(long[] ls) { this.ls = ls; }
-
- 	public void setShort(short s) { this.s = s; }
-
-	public void setShorts(short[] ss) { this.ss = ss; }	
-	
-	// This method has been added to test an issue when autoboxing.
-	public void setLong(long l, String s) {
-	    this.l = l;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Marker.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Marker.java
deleted file mode 100644
index 98252eb..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Marker.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Marker {
-    
-    String name();
-    
-    String[] arrayOfObjects();
-    
-    SubMarker sub();
-    
-    SubMarker[] arrayOfAnnotations();
-    
-    Type type();
-    
-    public enum Type {FOO, BAR, BAZ};
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PlopImpl.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PlopImpl.java
deleted file mode 100644
index 005dc0c..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/PlopImpl.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.Plop;
-//TODO this test requires source compatibility 1.5
-public class PlopImpl implements Plop {
-
-    public String getPlop() {
-        return "plop";
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SubMarker.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SubMarker.java
deleted file mode 100644
index 4ee14b9..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/SubMarker.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface SubMarker {
-    
-    String subname();
-
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/TestTypedList.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/TestTypedList.java
deleted file mode 100644
index cc8e3b3..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/component/TestTypedList.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-public class TestTypedList implements CheckService {
-    
-    private List<FooService> list;
-
-    public boolean check() {
-        return ! list.isEmpty();
-    }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        if (list != null) {
-            props.put("list", list);
-        
-            int i = 0;
-            for (FooService fs : list) {
-                props.put(i, fs.foo());
-                i++;
-            }
-        }
-        
-        return props;
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java
deleted file mode 100644
index 81b8831..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Annotation.java
+++ /dev/null
@@ -1,158 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.Method;
-import java.util.Arrays;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.test.scenarios.component.Marker;
-import org.apache.felix.ipojo.test.scenarios.component.SubMarker;
-
-public class Annotation extends OSGiTestCase {
-    
-    private Class clazz;
-    
-    public void setUp() {
-        try {
-            clazz = getContext().getBundle().
-                loadClass("org.apache.felix.ipojo.test.scenarios.component.Annotation");
-        } catch (ClassNotFoundException e) {
-            fail("Cannot load the annotation class : " + e.getMessage());
-        }
-    }
-    
-    public void testAnnotationOnMethod() {
-        Method method = null;
-        try {
-            method = this.clazz.getMethod("doSomething", new Class[0]);
-        } catch (Exception e) {
-            fail("Cannot find the doSomething method : " + e.getMessage());
-        } 
-        assertNotNull("Check method existence", method);
-        
-        java.lang.annotation.Annotation[] annotations = method.getDeclaredAnnotations();
-        assertNotNull("Check annotations size - 1", annotations);
-        assertEquals("Check annotations size - 2", 2, annotations.length); // Invisible is not visible
-        
-        /*
-            @Marker(name="marker", type=Type.BAR, 
-            sub=@SubMarker(subname="foo"),
-            arrayOfObjects={"foo", "bar", "baz"},
-            arrayOfAnnotations= {@SubMarker(subname="foo")}
-            )
-            @SubMarker(subname="bar")
-            @Invisible
-         */
-        
-        Marker marker = getMarkerAnnotation(annotations);
-        assertNotNull("Check marker", marker);
-        
-        assertEquals("Check marker name", "marker", marker.name());
-        assertEquals("Check marker type", Marker.Type.BAR, marker.type());
-        assertEquals("Check sub marker attribute", "foo", marker.sub().subname());
-        assertEquals("Check objects [0]", "foo", marker.arrayOfObjects()[0]);
-        assertEquals("Check objects [1]", "bar", marker.arrayOfObjects()[1]);
-        assertEquals("Check objects [2]", "baz", marker.arrayOfObjects()[2]);
-        assertEquals("Check annotations[0]", "foo", marker.arrayOfAnnotations()[0].subname());
-        
-        SubMarker sub = getSubMarkerAnnotation(annotations);
-        assertNotNull("Check submarker", sub);
-        assertEquals("Check submarker", "bar", sub.subname());
-        
-    }
-    
-    public void testAnnotationOnConstructor() {
-        Constructor method = null;
-        try {
-            method = clazz.getConstructor(new Class[0]);
-        } catch (Exception e) {
-            fail("Cannot find the constructor method : " + e.getMessage());
-        } 
-        assertNotNull("Check method existence", method);
-        
-        java.lang.annotation.Annotation[] annotations = method.getDeclaredAnnotations();
-        assertNotNull("Check annotations size - 1", annotations);
-        assertEquals("Check annotations size - 2", 2, annotations.length); // Invisible is not visible
-        
-        /*
-            @Marker(name="marker", type=Type.BAR, 
-            sub=@SubMarker(subname="foo"),
-            arrayOfObjects={"foo", "bar", "baz"},
-            arrayOfAnnotations= {@SubMarker(subname="foo")}
-            )
-            @SubMarker(subname="bar")
-            @Invisible
-         */
-        
-        Marker marker = getMarkerAnnotation(annotations);
-        assertNotNull("Check marker", marker);
-        
-        assertEquals("Check marker name", "marker", marker.name());
-        assertEquals("Check marker type", Marker.Type.BAR, marker.type());
-        assertEquals("Check sub marker attribute", "foo", marker.sub().subname());
-        assertEquals("Check objects [0]", "foo", marker.arrayOfObjects()[0]);
-        assertEquals("Check objects [1]", "bar", marker.arrayOfObjects()[1]);
-        assertEquals("Check objects [2]", "baz", marker.arrayOfObjects()[2]);
-        assertEquals("Check annotations[0]", "foo", marker.arrayOfAnnotations()[0].subname());
-        
-        SubMarker sub = getSubMarkerAnnotation(annotations);
-        assertNotNull("Check submarker", sub);
-        assertEquals("Check submarker", "bar", sub.subname());
-    }
-    
-    public void testParameterAnnotations() {
-        Method method = null;
-        try {
-            method = this.clazz.getMethod("doSomethingWithParams", new Class[] {String.class, String.class, String.class});
-        } catch (Exception e) {
-            fail("Cannot find the doSomethingWithParams method : " + e.getMessage());
-        } 
-        assertNotNull("Check method existence", method);
-        
-        java.lang.annotation.Annotation[][] annotations = method.getParameterAnnotations();
-        assertNotNull("Check annotations size - 1", annotations);
-        assertEquals("Check annotations size - 3", 3, annotations.length);
-        
-        // Check internals
-        // First parameter (foo)
-        java.lang.annotation.Annotation[] fooAnns = annotations[0];
-        assertEquals("Check fooAnns length", 1, fooAnns.length);
-        Marker marker = (Marker) fooAnns[0];
-        assertNotNull("Check marker", marker);
-        assertEquals("Check marker name", "marker", marker.name());
-        assertEquals("Check marker type", Marker.Type.BAR, marker.type());
-        assertEquals("Check sub marker attribute", "foo", marker.sub().subname());
-        assertEquals("Check objects [0]", "foo", marker.arrayOfObjects()[0]);
-        assertEquals("Check objects [1]", "bar", marker.arrayOfObjects()[1]);
-        assertEquals("Check objects [2]", "baz", marker.arrayOfObjects()[2]);
-        assertEquals("Check annotations[0]", "foo", marker.arrayOfAnnotations()[0].subname());
-        
-        // Second parameter (bar), no annotation (invisible)
-        java.lang.annotation.Annotation[] barAnns = annotations[1];
-        assertEquals("Check barAnns length", 0, barAnns.length);
-        
-        // Third parameter (baz), two annotations
-        java.lang.annotation.Annotation[] bazAnns = annotations[2];
-        System.out.println(Arrays.toString(bazAnns));
-        assertEquals("Check bazAnns length", 2, bazAnns.length);
-    }
-    
-    private Marker getMarkerAnnotation(java.lang.annotation.Annotation[] annotations) {
-        for (int i = 0; i < annotations.length; i++) {
-            if (annotations[i].annotationType().getName().equals("org.apache.felix.ipojo.test.scenarios.component.Marker")) {
-                return (Marker) annotations[i];
-            }
-        }
-        return null;
-    }
-    
-    private SubMarker getSubMarkerAnnotation(java.lang.annotation.Annotation[] annotations) {
-        for (int i = 0; i < annotations.length; i++) {
-            if (annotations[i].annotationType().getName().equals("org.apache.felix.ipojo.test.scenarios.component.SubMarker")) {
-                return (SubMarker) annotations[i];
-            }
-        }
-        return null;
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Boxing.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Boxing.java
deleted file mode 100644
index 871356a..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/Boxing.java
+++ /dev/null
@@ -1,51 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-import org.osgi.framework.ServiceReference;
-
-public class Boxing extends OSGiTestCase {
-    
-    ComponentInstance instance; // Instance under test
-
-    PrimitiveManipulationTestService prim;
-
-    ServiceReference prim_ref;
-    
-    IPOJOHelper helper;
-
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        Properties p1 = new Properties();
-        p1.put("instance.name","primitives");
-        instance = helper.createComponentInstance("ManipulationPrimitives5-PrimitiveManipulationTester", p1);
-        assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
-        prim_ref = helper.getServiceReferenceByName(PrimitiveManipulationTestService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check prim availability", prim_ref);
-        prim = (PrimitiveManipulationTestService) getServiceObject(prim_ref);
-    }
-
-    public void tearDown() {
-        helper.dispose();
-        prim = null;
-    }
-    
-  public void testLongFromObject() {
-      assertEquals("Check - 1", prim.getLong(), 1);
-      Long l = new Long(2);
-      prim.setLong(l);
-      assertEquals("Check - 2", prim.getLong(), 2);
-  }
-
-  public void testLongFromObject2() {
-      assertEquals("Check - 1", prim.getLong(), 1);
-      Long l = new Long(2);
-      prim.setLong(l, "ss");
-      assertEquals("Check - 2", prim.getLong(), 2);
-  }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/DuplicateMethod.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/DuplicateMethod.java
deleted file mode 100644
index aefa7cf..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/DuplicateMethod.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.Plop;
-import org.osgi.framework.ServiceReference;
-
-public class DuplicateMethod extends OSGiTestCase {
-    
-    
-    public void testDuplicateMethod() {
-        IPOJOHelper helper = new IPOJOHelper(this);
-        helper.createComponentInstance("plopimpl", "plop");
-        ServiceReference ref = helper.getServiceReferenceByName(Plop.class.getName(), "plop");
-        assertNotNull("Check plop", ref);
-        Plop plop = (Plop) getServiceObject(ref);
-        Object o = plop.getPlop();
-        assertEquals("Check result", "plop", o);
-        helper.dispose();
-    }
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
deleted file mode 100644
index 3cf22a3..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ManipulationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Manipulation Test Suite for Java 5", bc);
-        ots.addTestSuite(DuplicateMethod.class);
-        ots.addTestSuite(Boxing.class);
-        ots.addTestSuite(Annotation.class);
-        ots.addTestSuite(TypedList.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/TypedList.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/TypedList.java
deleted file mode 100644
index 72395c9..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/TypedList.java
+++ /dev/null
@@ -1,61 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import java.util.List;
-import java.util.Properties;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class TypedList extends OSGiTestCase {
-    
-    ComponentInstance foo1, foo2;
-    ComponentInstance checker;
-    IPOJOHelper helper; 
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        foo1 = helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.FooServiceImpl", "foo1");
-        foo2 = helper.createComponentInstance("org.apache.felix.ipojo.test.scenarios.component.FooServiceImpl", "foo2");
-        checker = helper.createComponentInstance("TypedList", "checker");
-        foo1.stop();
-        foo2.stop();
-    }
-    
-    public void tearDown() {
-        helper.dispose();
-    }
-    
-    public void testTypedList() {
-        ServiceReference ref = helper.getServiceReferenceByName(CheckService.class.getName(), checker.getInstanceName()); 
-        CheckService check = (CheckService) getServiceObject(ref);
-        assertNotNull("Checker availability", check);
-        // Check without providers
-        assertFalse("Empty list", check.check());
-        
-        // Start the first provider
-        foo1.start();
-        assertTrue("List with one element", check.check());
-        Properties props = check.getProps();
-        List<FooService> list = (List<FooService>) props.get("list");
-        assertEquals("Check size - 1", 1, list.size());
-        
-        // Start the second provider 
-        foo2.start();
-        assertTrue("List with two element", check.check());
-        props = check.getProps();
-        list = (List<FooService>) props.get("list");
-        assertEquals("Check size - 2", 2, list.size());
-        
-        // Stop the first one
-        foo1.stop();
-        assertTrue("List with one element (2)", check.check());
-        props = check.getProps();
-        list = (List<FooService>) props.get("list");
-        assertEquals("Check size - 3", 1, list.size());
-    }
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
deleted file mode 100644
index dfe2b9c..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
deleted file mode 100644
index ef7e1ee..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
deleted file mode 100644
index f1e8dc0..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
deleted file mode 100644
index 1bb177c..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface Plop {
-    
-   Object getPlop();
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java b/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
deleted file mode 100644
index cd61e3b..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface PrimitiveManipulationTestService {
-	
-	byte getByte();
-	void setByte(byte b);
-	
-	short getShort();
-	void setShort(short s);
-	
-	int getInt();
-	void setInt(int i);
-	
-	long getLong();
-	void setLong(long l);
-	
-	float getFloat();
-	void setFloat(float f);
-	
-	double getDouble();
-	void setDouble(double d);
-	
-	char getChar();
-	void setChar(char c);
-	
-	boolean getBoolean();
-	void setBoolean(boolean b);
-	
-	// Array types
-	byte[] getBytes();
-	void setBytes(byte[] bs);
-	
-	short[] getShorts();
-	void setShorts(short[] ss);
-	
-	int[] getInts();
-	void setInts(int is[]);
-	
-	long[] getLongs();
-	void setLongs(long[] ls);
-	
-	float[] getFloats();
-	void setFloats(float[] fs);
-	
-	double[] getDoubles();
-	void setDoubles(double[] ds);
-	
-	char[] getChars();
-	void setChars(char[] cs);
-	
-	boolean[] getBooleans();
-	void setBooleans(boolean[] bs);	
-	
-	// This method has been added to test an issue when autoboxing.
-	void setLong(long l, String s);
-
-}
diff --git a/ipojo/tests/manipulator/manipulator-java5/src/main/resources/metadata.xml b/ipojo/tests/manipulator/manipulator-java5/src/main/resources/metadata.xml
deleted file mode 100644
index a2ff517..0000000
--- a/ipojo/tests/manipulator/manipulator-java5/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,30 +0,0 @@
-<ipojo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-	xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-	xmlns="org.apache.felix.ipojo">
-	
-	<!-- Check duplicate method issue -->
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.PlopImpl"
-		name="plopimpl">
-		<provides></provides>
-	</component>
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
-		name="ManipulationPrimitives5-PrimitiveManipulationTester"
-		architecture="true">
-		<provides />
-	</component>
-	<component classname="org.apache.felix.ipojo.test.scenarios.component.Annotation"
-		name="Manipulation-Annotations" />
-	    
-	    
-	 <!-- Typed list -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooServiceImpl">
-		<provides />
-	</component>
-	<component 
-	    classname="org.apache.felix.ipojo.test.scenarios.component.TestTypedList" name="TypedList">
-	    <provides/>
-	    <requires field="list" optional="true" specification="org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService"/>
-	</component>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/manipulator/metadata/pom.xml b/ipojo/tests/manipulator/metadata/pom.xml
deleted file mode 100644
index 4eb056b..0000000
--- a/ipojo/tests/manipulator/metadata/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Manipulation Metadata Test Suite</name>
-  <artifactId>tests.manipulation.metadata</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.manipulator.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.manipulation.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Child.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Child.java
deleted file mode 100644
index bc1e310..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Child.java
+++ /dev/null
@@ -1,9 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class Child extends Parent {
-
-	public Child(String s) {
-		super(s);
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
deleted file mode 100644
index e49ede4..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooBarProviderType1.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-public class FooBarProviderType1 implements FooService, BarService {
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		return new Properties();
-	}
-
-	public boolean bar() {
-		return true;
-	}
-
-	public Properties getProps() {
-		return new Properties();
-	}
-
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
deleted file mode 100644
index 7fea38d..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderType1.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.BundleContext;
-
-public class FooProviderType1 implements FooService {
-	
-	private int m_bar;
-	private String m_foo;
-    
-    private BundleContext m_context;
-    
-    private static FooProviderType1 singleton;
-    private static int count = 0;
-    
-    private static FooProviderType1 singleton(BundleContext bc) {
-        if (singleton == null) {
-            count++;
-            singleton = new FooProviderType1(bc);
-        }
-        return singleton;
-    }
-    
-    public static FooProviderType1 several(BundleContext bc) {
-        count++;
-        return new FooProviderType1(bc);
-    }
-        
-    public FooProviderType1(BundleContext bc) {
-        if (bc ==null) {
-            throw new RuntimeException("Injected bundle context null");
-        }
-        m_context = bc;
-    }
-
-	public boolean foo() {
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("bar", new Integer(m_bar));
-        if(m_foo != null) {
-            p.put("foo", m_foo);
-        }
-        p.put("context", m_context);
-        
-        p.put("count", new Integer(count));
-		return p;
-	}
-    
-	public void testException() throws Exception {
-        String a = "foobarbaz";
-	    throw new Exception("foo"+a);
-    }
-    
-    public void testTry() {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    public void testTry2(String s) {
-            String a = "foo";
-            a.charAt(0);
-    }
-    
-    private void nexttry(String  s) {
-        try {
-            s += "foo";
-        } catch(RuntimeException e) {
-            
-        }
-    }
-    
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-	
-	/**
-	 * Custom constructor.
-	 * @param bar
-	 * @param foo
-	 * @param bc
-	 */
-	public FooProviderType1(int bar, String foo, BundleContext bc) {
-	    m_bar = bar;
-	    m_foo = foo;
-	    m_context = bc;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
deleted file mode 100644
index d5a9c87..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/FooProviderTypeDyn.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-public class FooProviderTypeDyn implements FooService {
-	
-	private int intProp;	
-	private String strProp;
-	private String[] strAProp;
-	private int[] intAProp;
-	private boolean boolProp;
-
-	public boolean foo() {
-		intProp = 3;
-		boolProp = true;
-		if(strProp.equals("foo")) { strProp = "bar"; }
-		else { strProp = "foo"; }
-		strAProp = new String[] {"foo", "bar", "baz"};
-		intAProp = new int[] {3, 2, 1};
-		return true;
-	}
-
-	public Properties fooProps() {
-		Properties p = new Properties();
-		p.put("intProp", new Integer(intProp));
-		p.put("boolProp", new Boolean(boolProp));
-		p.put("strProp", strProp);
-		p.put("strAProp", strAProp);
-		p.put("intAProp", intAProp);
-		return p;
-	}
-	
-	public boolean getBoolean() { return true; }
-
-	public double getDouble() { return 1.0; }
-
-	public int getInt() { return 1; }
-
-	public long getLong() { return 1; }
-
-	public Boolean getObject() { return new Boolean(true); }
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
deleted file mode 100644
index fb273c5..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-
-
-public class Manipulation23Tester implements PrimitiveManipulationTestService {
-	
-	// Integer types
-	byte b = 1;
-	short s = 1;
-	int i = 1;
-	long l = 1;
-	
-	// Floatting types
-	double d = 1.1;
-	float f = 1.1f;
-	
-	// Character
-	char c = 'a';
-	
-	// Boolean
-	boolean bool = false;
-	
-	// Integer arrays 
-	byte[] bs = new byte[] {0,1,2};
-	short[] ss = new short[] {0,1,2};
-	int[] is = new int[] {0,1,2};
-	long[] ls = new long[] {0,1,2};
-	
-	double[] ds = new double[] {0.0, 1.1, 2.2};
-	float[] fs = new float[] {0.0f, 1.1f, 2.2f};
-	
-	char[] cs = new char[] {'a', 'b', 'c'};
-	
-	boolean[] bools = new boolean[] {false, true, false};
-
-	public boolean getBoolean() { return bool; }
-
-	public boolean[] getBooleans() { return bools; }
-
-	public byte getByte() { return b; }
-
-	public byte[] getBytes() { return bs; }
-
-	public char getChar() { return c; }
-
-	public char[] getChars() { return cs; }
-
-	public double getDouble() { return d; }
-
-	public double[] getDoubles() { return ds; }
-
-	public float getFloat() { return f; }
-
-	public float[] getFloats() { return fs; }
-
-	public int getInt() { return i; }
-
-	public int[] getInts() { return is; }
-
-	public long getLong() { return l; }
-
-	public long[] getLongs() { return ls; }
-
-	public short getShort() { return s; }
-
-	public short[] getShorts() { return ss; }
-
-	public void setBoolean(boolean b) { this.bool = b; }
-
-	public void setBooleans(boolean[] bs) { this.bools = bs; }
-
-	public void setByte(byte b) { this.b = b; }
-
-	public void setBytes(byte[] bs) { this.bs = bs; }
-
-	public void setChar(char c) { this.c = c; }
-
-	public void setChars(char[] cs) { this.cs = cs; }
-
-	public void setDouble(double d) { this.d = d; }
-
-	public void setDoubles(double[] ds) { this.ds = ds; }
-
-	public void setFloat(float f) { this.f = f; }
-
-	public void setFloats(float[] fs) { this.fs = fs; }
-
-	public void setInt(int i) { this.i = i; }
-
-	public void setInts(int[] is) { this.is = is; }
-
-	public void setLong(long l) { this.l = l; }
-
-	public void setLongs(long[] ls) { this.ls = ls; }
-
- 	public void setShort(short s) { this.s = s; }
-
-	public void setShorts(short[] ss) { this.ss = ss; }	
-	
-	// This method has been added to test an issue when autoboxing.
-	public void setLong(long l, String s) {
-	    this.l = l;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Multiconstructor.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Multiconstructor.java
deleted file mode 100644
index e9a51af..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Multiconstructor.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class Multiconstructor {
-
-	public Multiconstructor(String s1, String s2) {
-		this(s1, s2, -1);
-	}
-
-	public Multiconstructor(String s1, int s2) {
-		this(s1, "" + s2, s2);
-	}
-
-	public Multiconstructor(String s1, String s2, int i) {
-		//...
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
deleted file mode 100644
index 79dc2ef..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/MultipleCheckService.java
+++ /dev/null
@@ -1,158 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import java.util.Properties;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.CheckService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-import org.osgi.framework.ServiceReference;
-
-public class MultipleCheckService implements CheckService {
-
-    FooService fs[];
-
-    int simpleB = 0;
-
-    int objectB = 0;
-
-    int refB = 0;
-
-    int bothB = 0;
-
-    int simpleU = 0;
-
-    int objectU = 0;
-
-    int refU = 0;
-
-    int bothU = 0;
-
-    public boolean check() {
-        boolean r = fs.length != 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r & fs[i].foo();
-        }
-        return r;
-    }
-
-    private boolean getBoolean() {
-        return check();
-    }
-
-    private int getInt() {
-        int r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    private long getLong() {
-        long r = 0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getLong();
-        }
-        return r;
-    }
-
-    private double getDouble() {
-        double r = 0.0;
-        for (int i = 0; i < fs.length; i++) {
-            r = r + fs[i].getInt();
-        }
-        return r;
-    }
-
-    protected Object doNothing(Object o, String s) {
-        return null;
-    }
-
-    // private Object getObject() {
-    // boolean r = true;
-    // for(int i = 0; i < fs.length; i++) {
-    // r = r && ((Boolean) fs[i].getObject()).booleanValue();
-    // }
-    // return new Boolean(r);
-    // }
-
-    public Properties getProps() {
-        Properties props = new Properties();
-        props.put("result", new Boolean(check()));
-        props.put("voidB", new Integer(simpleB));
-        props.put("objectB", new Integer(objectB));
-        props.put("refB", new Integer(refB));
-        props.put("bothB", new Integer(bothB));
-        props.put("voidU", new Integer(simpleU));
-        props.put("objectU", new Integer(objectU));
-        props.put("refU", new Integer(refU));
-        props.put("bothU", new Integer(bothU));
-        props.put("boolean", new Boolean(getBoolean()));
-        props.put("int", new Integer(getInt()));
-        props.put("long", new Long(getLong()));
-        props.put("double", new Double(getDouble()));
-
-        return props;
-    }
-
-    public void voidBind() {
-        simpleB++;
-    }
-
-    public void voidUnbind() {
-        simpleU++;
-    }
-
-    public void objectBind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectB++;
-        }
-    }
-
-    public void objectUnbind(FooService o) {
-        if (o != null && o instanceof FooService) {
-            objectU++;
-        }
-    }
-
-    public void refBind(ServiceReference sr) {
-        if (sr != null) {
-            refB++;
-        }
-    }
-
-    public void refUnbind(ServiceReference sr) {
-        if (sr != null) {
-            refU++;
-        }
-    }
-
-    public void bothBind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothB++;
-        }
-    }
-
-    public void bothUnbind(FooService o, ServiceReference sr) {
-        if (o != null && o instanceof FooService && sr != null) {
-            bothU++;
-        }
-    }
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Parent.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Parent.java
deleted file mode 100644
index feaaff1..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Parent.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.component;
-
-public class Parent {
-
-	private String s;
-
-	public Parent(String s) {
-		this.s = s;
-	}
-
-	public String getS() {
-		return s;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
deleted file mode 100644
index f1a0e39..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadata.java
+++ /dev/null
@@ -1,239 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.parser.ParseUtils;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-/**
- * Check manipulation metadata written in the manifest.
- */
-public class ManipulationMetadata extends OSGiTestCase {
-
-	public void testGetMetadata() {
-		String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
-		Element elem = null;
-		try {
-			elem = ManifestMetadataParser.parseHeaderMetadata(header);
-		} catch (ParseException e) {
-			fail("Parse Exception when parsing iPOJO-Component");
-		}
-		
-		assertNotNull("Check elem not null", elem);
-		
-		Element manip = getManipulationForComponent(elem, "ManipulationMetadata-FooProviderType-1");
-		assertNotNull("Check manipulation metadata not null for " + "FooProviderType-1", manip);
-	}
-	
-	public void testInterface() {
-		String comp_name = "ManipulationMetadata-FooProviderType-1";
-		Element manip = getManipulationForComponent(comp_name);
-		Element[] itf = manip.getElements("Interface");
-		assertEquals("Check interfaces number", itf.length, 1);
-		assertEquals("Check itf name", itf[0].getAttribute("name"), FooService.class.getName());
-	}
-	
-	public void testInterfaces() {
-		String comp_name = "ManipulationMetadata-FooBarProviderType-1";
-		Element manip = getManipulationForComponent(comp_name);
-		Element[] itf = manip.getElements("Interface");
-		assertEquals("Check interfaces number", itf.length, 2);
-		assertEquals("Check itf name", itf[0].getAttribute("name"), FooService.class.getName());
-		assertEquals("Check itf name", itf[1].getAttribute("name"), BarService.class.getName());
-	}
-	
-	public void testFields() {
-		String comp_name = "ManipulationMetadata-FooProviderType-Dyn";
-		Element manip = getManipulationForComponent(comp_name);
-		Element[] fields = manip.getElements("field");
-		assertEquals("Check field count " + fields.length, fields.length, 5);
-		/*
-		private int intProp;	
-		private String strProp;
-		private String[] strAProp;
-		private int[] intAProp;
-		private boolean boolProp;
-		 */
-		
-		Element field;
-		
-		field = getFieldFromName(manip, "intProp");		
-		assertEquals("Check field name : " + field.getAttribute("name"), field.getAttribute("name"), "intProp");
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "int");
-		
-		field = getFieldFromName(manip, "strProp");
-		assertEquals("Check field name : " + field.getAttribute("name"), field.getAttribute("name"), "strProp");
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "java.lang.String");
-		
-		field = getFieldFromName(manip, "strAProp");
-		assertEquals("Check field name : " + field.getAttribute("name"), field.getAttribute("name"), "strAProp");
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "java.lang.String[]");
-		
-		field = getFieldFromName(manip, "intAProp");
-		assertEquals("Check field name : " + field.getAttribute("name"), field.getAttribute("name"), "intAProp");
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "int[]");
-		
-		field = getFieldFromName(manip, "boolProp");
-		assertEquals("Check field name : " + field.getAttribute("name"), field.getAttribute("name"), "boolProp");
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "boolean");
-	}
-	
-	public void testPrimitivesFields() {
-		String comp_name = "ManipulationMetadata-PrimitiveManipulationTester";
-		Element manip = getManipulationForComponent(comp_name);
-		Element[] fields = manip.getElements("Field");
-		assertEquals("Check field count", fields.length, 16);
-		/*
-		byte b = 1;
-		short s = 1;
-		int i = 1;
-		long l = 1;
-		double d = 1.1;
-		float f = 1.1f;
-		char c = 'a';
-		boolean bool = false;
-		byte[] bs = new byte[] {0,1,2};
-		short[] ss = new short[] {0,1,2};
-		int[] is = new int[] {0,1,2};
-		long[] ls = new long[] {0,1,2};
-		double[] ds = new double[] {0.0, 1.1, 2.2};
-		float[] fs = new float[] {0.0f, 1.1f, 2.2f};
-		char[] cs = new char[] {'a', 'b', 'c'};
-		boolean[] bools = new boolean[] {false, true, false};
-		 */
-		Element field;
-
-		field = getFieldFromName(manip, "b");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "byte");
-		field = getFieldFromName(manip, "s");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "short");
-		field = getFieldFromName(manip, "i");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "int");
-		field = getFieldFromName(manip, "l");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "long");
-		field = getFieldFromName(manip, "d");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "double");
-		field = getFieldFromName(manip, "f");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "float");
-		field = getFieldFromName(manip, "c");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "char");
-		field = getFieldFromName(manip, "bool");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "boolean");
-		
-		field = getFieldFromName(manip, "bs");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "byte[]");
-		field = getFieldFromName(manip, "ss");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "short[]");
-		field = getFieldFromName(manip, "is");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "int[]");
-		field = getFieldFromName(manip, "ls");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "long[]");
-		field = getFieldFromName(manip, "ds");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "double[]");
-		field = getFieldFromName(manip, "fs");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "float[]");
-		field = getFieldFromName(manip, "cs");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "char[]");
-		field = getFieldFromName(manip, "bools");		
-		assertEquals("Check field type : " + field.getAttribute("name"), field.getAttribute("type"), "boolean[]");		
-	}
-	
-	public void testNoArgMethod() {
-		String comp_name = "ManipulationMetadata-SimpleMultipleCheckServiceProvider";
-		Element manip = getManipulationForComponent(comp_name);
-		Element method = getMethodFromName(manip, "check");
-		assertFalse("Check no args", method.containsAttribute("arguments"));
-		assertEquals("Check return", method.getAttribute("return"), "boolean");
-	}
-	
-	public void testOneArgsMethod() {
-		String comp_name = "ManipulationMetadata-SimpleMultipleCheckServiceProvider";
-		Element manip = getManipulationForComponent(comp_name);
-		Element method = getMethodFromName(manip, "refBind");
-		assertEquals("Check args", method.getAttribute("arguments"), "{org.osgi.framework.ServiceReference}");
-		assertEquals("Check args count", 1, ParseUtils.parseArrays("{org.osgi.framework.ServiceReference}").length);
-		assertFalse("Check return", method.containsAttribute("return"));
-	}
-	
-	public void testTwoArgsMethod() {
-		String comp_name = "ManipulationMetadata-SimpleMultipleCheckServiceProvider";
-		Element manip = getManipulationForComponent(comp_name);
-		Element method = getMethodFromName(manip, "doNothing");
-		assertEquals("Check args", method.getAttribute("arguments"), "{java.lang.Object,java.lang.String}");
-		assertEquals("Check args count", 2, ParseUtils.parseArrays("{java.lang.Object,java.lang.String}").length);
-		assertEquals("Check return", method.getAttribute("return"), "java.lang.Object");
-	}
-	
-	private Element getManipulationForComponent(Element metadata, String comp_name) {
-		Element[] comps = metadata.getElements("component");
-		for(int i = 0; i < comps.length; i++) {
-			if(comps[i].containsAttribute("factory") && comps[i].getAttribute("factory").equals(comp_name)) {
-				return comps[i].getElements("manipulation")[0];
-			}
-            if(comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
-                return comps[i].getElements("manipulation")[0];
-            }
-		}
-		return null;
-	}
-	
-	private Element getManipulationForComponent(String comp_name) {
-		String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
-		Element elem = null;
-		try {
-			elem = ManifestMetadataParser.parseHeaderMetadata(header);
-		} catch (ParseException e) {
-			fail("Parse Exception when parsing iPOJO-Component");
-		}
-		
-		assertNotNull("Check elem not null", elem);		
-		Element manip = getManipulationForComponent(elem, comp_name);
-		assertNotNull("Check manipulation metadata not null for " + comp_name, manip);
-		return manip;
-	}
-	
-	private Element getMethodFromName(Element manip, String name) {
-		Element methods[] = manip.getElements("Method");
-		for(int i = 0; i < methods.length; i++) {
-			if(methods[i].containsAttribute("name") && methods[i].getAttribute("name").equals(name)) {
-				return methods[i];
-			}
-		}
-		fail("Method " + name + " not found");
-		return null;
-	}
-	
-	private Element getFieldFromName(Element manip, String name) {
-		Element fields[] = manip.getElements("Field");
-		for(int i = 0; i < fields.length; i++) {
-			if(fields[i].containsAttribute("name") && fields[i].getAttribute("name").equals(name)) {
-				return fields[i];
-			}
-		}
-		fail("Field " + name + " not found");
-		return null;
-	}
-	
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
deleted file mode 100644
index cdb9c94..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationMetadataAPI.java
+++ /dev/null
@@ -1,289 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.ConfigurationException;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.metadata.Element;
-import org.apache.felix.ipojo.parser.FieldMetadata;
-import org.apache.felix.ipojo.parser.ManifestMetadataParser;
-import org.apache.felix.ipojo.parser.MethodMetadata;
-import org.apache.felix.ipojo.parser.ParseException;
-import org.apache.felix.ipojo.parser.PojoMetadata;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.BarService;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.FooService;
-
-public class ManipulationMetadataAPI extends OSGiTestCase {
-    
-    PojoMetadata FooProviderType1, FooBarProviderType1, FooProviderTypeDyn, PrimitiveManipulationTester, SimpleMultipleCheckServiceProvider;
-
-	public void setUp() {
-        String comp_name = "ManipulationMetadata-FooProviderType-1";
-        FooProviderType1 = getManipulationMetadataForComponent(comp_name);
-        
-        comp_name = "ManipulationMetadata-FooBarProviderType-1";
-        FooBarProviderType1 = getManipulationMetadataForComponent(comp_name);
-        
-        comp_name = "ManipulationMetadata-FooProviderType-Dyn";
-        FooProviderTypeDyn = getManipulationMetadataForComponent(comp_name);
-
-        comp_name = "ManipulationMetadata-PrimitiveManipulationTester";
-        PrimitiveManipulationTester = getManipulationMetadataForComponent(comp_name);
-        
-        comp_name = "ManipulationMetadata-SimpleMultipleCheckServiceProvider";
-        SimpleMultipleCheckServiceProvider = getManipulationMetadataForComponent(comp_name);
-	}
-	
-	public void testGetMetadata() {
-		String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
-		Element elem = null;
-		try {
-			elem = ManifestMetadataParser.parseHeaderMetadata(header);
-		} catch (ParseException e) {
-			fail("Parse Exception when parsing iPOJO-Component");
-		}
-		
-		assertNotNull("Check elem not null", elem);
-		
-		Element manip = getMetadataForComponent(elem, "ManipulationMetadata-FooProviderType-1");
-        assertNotNull("Check manipulation metadata not null for " + "Manipulation-FooProviderType-1", manip);
-        PojoMetadata mm;
-        try {
-            mm = new PojoMetadata(manip);
-            assertNotNull("Check mm not null", mm);
-        } catch (ConfigurationException e) {
-            fail("The creation of pojo metadata has failed");
-        }
-	}
-	
-	public void testInterface() {
-	    PojoMetadata manip = FooProviderType1;
-		
-        String[] itf = manip.getInterfaces();
-		assertEquals("Check interfaces number", itf.length, 1);
-		assertEquals("Check itf name", itf[0], FooService.class.getName());
-        
-        assertTrue("Check Foo Service implementation", manip.isInterfaceImplemented(FooService.class.getName()));
-        assertFalse("Check Bar Service implementation", manip.isInterfaceImplemented(BarService.class.getName()));
-	}
-	
-	public void testInterfaces() {
-	    PojoMetadata manip = FooBarProviderType1;
-        String[] itf = manip.getInterfaces();
-		assertEquals("Check interfaces number", itf.length, 2);
-		assertEquals("Check itf name", itf[0], FooService.class.getName());
-		assertEquals("Check itf name", itf[1], BarService.class.getName());
-        
-        assertTrue("Check Foo Service implementation", manip.isInterfaceImplemented(FooService.class.getName()));
-        assertTrue("Check Bar Service implementation", manip.isInterfaceImplemented(BarService.class.getName()));
-	}
-	
-	public void testFields() {
-	    PojoMetadata manip = FooProviderTypeDyn;
-		
-		FieldMetadata[] fields = manip.getFields();
-		assertEquals("Check field count + " + fields.length, fields.length, 5);
-		/*
-		private int intProp;	
-		private String strProp;
-		private String[] strAProp;
-		private int[] intAProp;
-		private boolean boolProp;
-		 */
-		
-		FieldMetadata field;
-		
-		field = manip.getField("intProp");		
-		assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "intProp");
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int");
-        assertEquals("Check field reflective type : " + field.getFieldName(), FieldMetadata.getReflectionType(field.getFieldType()), "int");
-        
-        field = manip.getField("intProp", "int");      
-        assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "intProp");
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int");
-        
-        field = manip.getField("intProp", "long");
-        assertNull("Check bad field", field);
-		
-		field = manip.getField("strProp");
-		assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "strProp");
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "java.lang.String");
-        assertEquals("Check field reflective type : " + field.getFieldName(), FieldMetadata.getReflectionType(field.getFieldType()), "java.lang.String");
-        
-        field = manip.getField("strProp", "String");
-        assertNull("Check bad field", field);
-        
-        field = manip.getField("strProp", "java.lang.String");
-        assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "strProp");
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "java.lang.String");
-		
-		field = manip.getField("strAProp");
-		assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "strAProp");
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "java.lang.String[]");
-        assertEquals("Check field reflective type : " + field.getFieldName() + " -> " + FieldMetadata.getReflectionType(field.getFieldType()), FieldMetadata.getReflectionType(field.getFieldType()), "[Ljava.lang.String;");
-        
-        field = manip.getField("strAProp", "java.lang.String[]");
-        assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "strAProp");
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "java.lang.String[]");
-        
-        field = manip.getField("strAProp", "String[]");
-        assertNull("Check bad field", field);
-		
-		field = manip.getField("intAProp");
-		assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "intAProp");
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int[]");
-        assertEquals("Check field reflective type : " + field.getFieldName() + " -> " + FieldMetadata.getReflectionType(field.getFieldType()), FieldMetadata.getReflectionType(field.getFieldType()), "[I");
-        
-        field = manip.getField("intAProp", "int[]");
-        assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "intAProp");
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int[]");
-        
-        field = manip.getField("intAProp", "String[]");
-        assertNull("Check bad field", field);
-		
-		field = manip.getField("boolProp");
-		assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "boolProp");
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "boolean");
-        assertEquals("Check field reflective type : " + field.getFieldName(), FieldMetadata.getReflectionType(field.getFieldType()), "boolean");
-        
-        field = manip.getField("boolProp", "boolean");
-        assertEquals("Check field name : " + field.getFieldName(), field.getFieldName(), "boolProp");
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "boolean");
-        
-        field = manip.getField("boolProp", "bool");
-        assertNull("Check bad field", field);
-	}
-	
-	public void testPrimitivesFields() {
-	    PojoMetadata manip = PrimitiveManipulationTester;
-		FieldMetadata[] fields = manip.getFields();
-		assertEquals("Check field count", fields.length, 16);
-
-		FieldMetadata field;
-
-		field = manip.getField("b");		
-		assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "byte");
-		field = manip.getField("s");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "short");
-		field = manip.getField("i");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int");
-		field = manip.getField("l");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "long");
-		field = manip.getField("d");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "double");
-		field = manip.getField("f");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "float");
-		field = manip.getField("c");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "char");
-		field = manip.getField("bool");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "boolean");
-		
-		field = manip.getField("bs");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "byte[]");
-		field = manip.getField("ss");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "short[]");
-		field = manip.getField("is");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "int[]");
-		field = manip.getField("ls");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "long[]");
-		field = manip.getField("ds");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "double[]");
-		field = manip.getField("fs");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "float[]");
-		field = manip.getField("cs");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "char[]");
-		field = manip.getField("bools");		
-        assertEquals("Check field type : " + field.getFieldName(), field.getFieldType(), "boolean[]");		
-	}
-	
-	public void testNoArgMethod() {
-	    PojoMetadata manip = SimpleMultipleCheckServiceProvider;
-		MethodMetadata method = manip.getMethod("check");
-		assertEquals("Check no args", method.getMethodArguments().length, 0);
-		assertEquals("Check return", method.getMethodReturn(), "boolean");
-        
-        method = manip.getMethod("check", new String[0]);
-        assertEquals("Check no args", method.getMethodArguments().length, 0);
-        assertEquals("Check return", method.getMethodReturn(), "boolean");
-	}
-	
-	public void testOneArgsMethod() {
-	    PojoMetadata manip = SimpleMultipleCheckServiceProvider;
-        MethodMetadata method = manip.getMethods("refBind")[0];
-		assertEquals("Check args count", method.getMethodArguments().length, 1);
-        assertEquals("Check args", method.getMethodArguments()[0], "org.osgi.framework.ServiceReference");
-		assertEquals("Check return", method.getMethodReturn(), "void");
-        
-        method = manip.getMethod("refBind", new String[] {"org.osgi.framework.ServiceReference"});
-        assertEquals("Check args count", method.getMethodArguments().length, 1);
-        assertEquals("Check args", method.getMethodArguments()[0], "org.osgi.framework.ServiceReference");
-        assertEquals("Check return", method.getMethodReturn(), "void");
-	}
-	
-	public void testTwoArgsMethod() {
-	    PojoMetadata manip = SimpleMultipleCheckServiceProvider;
-        MethodMetadata method = manip.getMethods("doNothing")[0];
-        assertEquals("Check args count", 2, method.getMethodArguments().length);
-		assertEquals("Check args - 1", method.getMethodArguments()[0], "java.lang.Object");
-        assertEquals("Check args - 2", method.getMethodArguments()[1], "java.lang.String");
-		assertEquals("Check return", method.getMethodReturn(), "java.lang.Object");
-        
-        method = manip.getMethod("doNothing", new String[] {"java.lang.Object", "java.lang.String"});
-        assertEquals("Check args count", 2, method.getMethodArguments().length);
-        assertEquals("Check args - 1", method.getMethodArguments()[0], "java.lang.Object");
-        assertEquals("Check args - 2", method.getMethodArguments()[1], "java.lang.String");
-        assertEquals("Check return", method.getMethodReturn(), "java.lang.Object");
-	}
-	
-	private Element getMetadataForComponent(Element metadata, String comp_name) {
-		Element[] comps = metadata.getElements("component");
-		for(int i = 0; i < comps.length; i++) {
-			if(comps[i].containsAttribute("factory") && comps[i].getAttribute("factory").equals(comp_name)) {
-				return comps[i];
-			}
-            if(comps[i].containsAttribute("name") && comps[i].getAttribute("name").equals(comp_name)) {
-                return comps[i];
-            }
-		}
-		return null;
-	}
-	
-    
-    private PojoMetadata getManipulationMetadataForComponent(String comp_name) {
-        String header = (String) context.getBundle().getHeaders().get("iPOJO-Components");
-        Element elem = null;
-        try {
-            elem = ManifestMetadataParser.parseHeaderMetadata(header);
-        } catch (ParseException e) {
-            fail("Parse Exception when parsing iPOJO-Component");
-        }
-        
-        assertNotNull("Check elem not null", elem);
-        
-        Element manip = getMetadataForComponent(elem, comp_name);
-        assertNotNull("Check manipulation metadata not null for " + comp_name, manip);
-        try {
-            return new PojoMetadata(manip);
-        } catch (ConfigurationException e) {
-            fail("The creation of pojo metadata for " + comp_name + " has failed");
-            return null;
-        }
-    }	
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
deleted file mode 100644
index c782bbc..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ManipulationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Manipulation Metadata Test Suite", bc);
-		ots.addTestSuite(ManipulationMetadata.class);
-        ots.addTestSuite(ManipulationMetadataAPI.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
deleted file mode 100644
index 5f5b74b..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service.A123;
-
-public interface CheckService2 {
-	
-	public boolean check();
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
deleted file mode 100644
index dfe2b9c..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
deleted file mode 100644
index ef7e1ee..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
deleted file mode 100644
index f1e8dc0..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
deleted file mode 100644
index 1bb177c..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface Plop {
-    
-   Object getPlop();
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
deleted file mode 100644
index cd61e3b..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface PrimitiveManipulationTestService {
-	
-	byte getByte();
-	void setByte(byte b);
-	
-	short getShort();
-	void setShort(short s);
-	
-	int getInt();
-	void setInt(int i);
-	
-	long getLong();
-	void setLong(long l);
-	
-	float getFloat();
-	void setFloat(float f);
-	
-	double getDouble();
-	void setDouble(double d);
-	
-	char getChar();
-	void setChar(char c);
-	
-	boolean getBoolean();
-	void setBoolean(boolean b);
-	
-	// Array types
-	byte[] getBytes();
-	void setBytes(byte[] bs);
-	
-	short[] getShorts();
-	void setShorts(short[] ss);
-	
-	int[] getInts();
-	void setInts(int is[]);
-	
-	long[] getLongs();
-	void setLongs(long[] ls);
-	
-	float[] getFloats();
-	void setFloats(float[] fs);
-	
-	double[] getDoubles();
-	void setDoubles(double[] ds);
-	
-	char[] getChars();
-	void setChars(char[] cs);
-	
-	boolean[] getBooleans();
-	void setBooleans(boolean[] bs);	
-	
-	// This method has been added to test an issue when autoboxing.
-	void setLong(long l, String s);
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index bcec3d5..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-//import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/manipulator/metadata/src/main/resources/metadata.xml b/ipojo/tests/manipulator/metadata/src/main/resources/metadata.xml
deleted file mode 100644
index df45f15..0000000
--- a/ipojo/tests/manipulator/metadata/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/CURRENT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-	<!-- Simple provider  used for manipulation analysis -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderType1"
-		name="ManipulationMetadata-FooProviderType-1" architecture="true">
-		<provides />
-	</component>
-
-	<!-- Provider providing 2 services -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooBarProviderType1"
-		name="ManipulationMetadata-FooBarProviderType-1" architecture="true">
-		<provides />
-	</component>
-
-	<!-- Provider with dynamic property -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.FooProviderTypeDyn"
-		name="ManipulationMetadata-FooProviderType-Dyn" architecture="true">
-		<provides>
-			<property name="int" field="intProp" value="2" />
-			<property name="boolean" field="boolProp" value="false" />
-			<property name="string" field="strProp" value="foo" />
-			<property name="strAProp" field="strAProp"
-				value="[foo, bar]" />
-			<property name="intAProp" field="intAProp" value="[ 1,2,3]" />
-		</provides>
-	</component>
-
-	<!-- Manipulation -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
-		name="ManipulationMetadata-PrimitiveManipulationTester" architecture="true">
-		<provides />
-	</component>
-
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.MultipleCheckService"
-		name="ManipulationMetadata-SimpleMultipleCheckServiceProvider" architecture="true">
-		<requires field="fs" />
-		<provides />
-	</component>
-
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.Child">
-	</component>
-
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.Multiconstructor">
-    </component>
-</ipojo>
diff --git a/ipojo/tests/manipulator/primitives/pom.xml b/ipojo/tests/manipulator/primitives/pom.xml
deleted file mode 100644
index 921bc1c..0000000
--- a/ipojo/tests/manipulator/primitives/pom.xml
+++ /dev/null
@@ -1,111 +0,0 @@
-<!--
-  Licensed to the Apache Software Foundation (ASF) under one
-  or more contributor license agreements.  See the NOTICE file
-  distributed with this work for additional information
-  regarding copyright ownership.  The ASF licenses this file
-  to you under the Apache License, Version 2.0 (the
-  "License"); you may not use this file except in compliance
-  with the License.  You may obtain a copy of the License at
-
-  http://www.apache.org/licenses/LICENSE-2.0
-
-  Unless required by applicable law or agreed to in writing,
-  software distributed under the License is distributed on an
-  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-  KIND, either express or implied.  See the License for the
-  specific language governing permissions and limitations
-  under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-  <parent>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <relativePath>../../pom.xml</relativePath>
-  </parent>
-  <modelVersion>4.0.0</modelVersion>
-  <packaging>bundle</packaging>
-  <name>iPOJO Primitive Manipulation Test Suite</name>
-  <artifactId>tests.manipulation.primitives</artifactId>
-  <groupId>ipojo.tests</groupId>
-  <version>${ipojo.manipulator.snapshot}</version>
-  <dependencies>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo</artifactId>
-      <version>${ipojo.core.snapshot}</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.core</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>junit</groupId>
-      <artifactId>junit</artifactId>
-      <version>3.8.1</version>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.felix</groupId>
-      <artifactId>org.apache.felix.ipojo.junit4osgi</artifactId>
-      <version>1.1.0-SNAPSHOT</version>
-    </dependency>
-    <dependency>
-      <groupId>org.osgi</groupId>
-      <artifactId>org.osgi.compendium</artifactId>
-      <version>4.0.0</version>
-    </dependency>
-  </dependencies>
-  <build>
-    <plugins>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-bundle-plugin</artifactId>
-        <extensions>true</extensions>
-        <configuration>
-          <instructions>
-            <Export-Package>
-              org.apache.felix.ipojo.test.scenarios.manipulation.service
-            </Export-Package>
-            <Bundle-SymbolicName>
-              ${project.artifactId}
-            </Bundle-SymbolicName>
-            <Private-Package>
-              org.apache.felix.ipojo.test*
-            </Private-Package>
-            <Test-Suite>
-              org.apache.felix.ipojo.test.scenarios.manipulation.ManipulationTestSuite
-            </Test-Suite>
-          </instructions>
-        </configuration>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.felix</groupId>
-        <artifactId>maven-ipojo-plugin</artifactId>
-        <version>${ipojo.manipulator.snapshot}</version>
-        <executions>
-          <execution>
-            <goals>
-              <goal>ipojo-bundle</goal>
-            </goals>
-            <configuration>
-              <ignoreAnnotations>true</ignoreAnnotations>
-            </configuration>
-          </execution>
-        </executions>
-      </plugin>
-      <plugin>
-        <groupId>org.apache.maven.plugins</groupId>
-        <artifactId>maven-compiler-plugin</artifactId>
-        <configuration>
-          <source>1.4</source>
-          <target>1.4</target>
-        </configuration>
-      </plugin>
-    </plugins>
-  </build>
-</project>
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
deleted file mode 100644
index 019980f..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/A123/Manipulation23Tester.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component.A123;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-
-
-public class Manipulation23Tester implements PrimitiveManipulationTestService {
-
-    
-    // Integer types
-	byte b = 1;
-	short s = 1;
-	int i = 1;
-	long l = 1;
-	
-	// Floatting types
-	double d = 1.1;
-	float f = 1.1f;
-	
-	// Character
-	char c = 'a';
-	
-	// Boolean
-	boolean bool = false;
-	
-	// Integer arrays 
-	byte[] bs = new byte[] {0,1,2};
-	short[] ss = new short[] {0,1,2};
-	int[] is = new int[] {0,1,2};
-	long[] ls = new long[] {0,1,2};
-	
-	double[] ds = new double[] {0.0, 1.1, 2.2};
-	float[] fs = new float[] {0.0f, 1.1f, 2.2f};
-	
-	char[] cs = new char[] {'a', 'b', 'c'};
-	
-	boolean[] bools = new boolean[] {false, true, false};
-
-	public boolean getBoolean() { return bool; }
-
-	public boolean[] getBooleans() { return bools; }
-
-	public byte getByte() { return b; }
-
-	public byte[] getBytes() { return bs; }
-
-	public char getChar() { return c; }
-
-	public char[] getChars() { return cs; }
-
-	public double getDouble() { return d; }
-
-	public double[] getDoubles() { return ds; }
-
-	public float getFloat() { return f; }
-
-	public float[] getFloats() { return fs; }
-
-	public int getInt() { return i; }
-
-	public int[] getInts() { return is; }
-
-	public long getLong() { return l; }
-
-	public long[] getLongs() { return ls; }
-
-	public short getShort() { return s; }
-
-	public short[] getShorts() { return ss; }
-
-	public void setBoolean(boolean b) { this.bool = b; }
-
-	public void setBooleans(boolean[] bs) { this.bools = bs; }
-
-	public void setByte(byte b) { this.b = b; }
-
-	public void setBytes(byte[] bs) { this.bs = bs; }
-
-	public void setChar(char c) { this.c = c; }
-
-	public void setChars(char[] cs) { this.cs = cs; }
-
-	public void setDouble(double d) { this.d = d; }
-
-	public void setDoubles(double[] ds) { this.ds = ds; }
-
-	public void setFloat(float f) { this.f = f; }
-
-	public void setFloats(float[] fs) { this.fs = fs; }
-
-	public void setInt(int i) { this.i = i; }
-
-	public void setInts(int[] is) { this.is = is; }
-
-	public void setLong(long l) { this.l = l; }
-
-	public void setLongs(long[] ls) { this.ls = ls; }
-
- 	public void setShort(short s) { this.s = s; }
-
-	public void setShorts(short[] ss) { this.ss = ss; }	
-	
-	public void setLong(long l, String s) {
-	    this.l = l;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
deleted file mode 100644
index 29415ea..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/component/Manipulation23Tester.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.component;
-
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-
-
-public class Manipulation23Tester implements PrimitiveManipulationTestService {
-	
-	// Integer types
-	byte b = 1;
-	short s = 1;
-	int i = 1;
-	long l = 1;
-	
-	// Floatting types
-	double d = 1.1;
-	float f = 1.1f;
-	
-	// Character
-	char c = 'a';
-	
-	// Boolean
-	boolean bool = false;
-	
-	// Integer arrays 
-	byte[] bs = new byte[] {0,1,2};
-	short[] ss = new short[] {0,1,2};
-	int[] is = new int[] {0,1,2};
-	long[] ls = new long[] {0,1,2};
-	
-	double[] ds = new double[] {0.0, 1.1, 2.2};
-	float[] fs = new float[] {0.0f, 1.1f, 2.2f};
-	
-	char[] cs = new char[] {'a', 'b', 'c'};
-	
-	boolean[] bools = new boolean[] {false, true, false};
-
-	public boolean getBoolean() { return bool; }
-
-	public boolean[] getBooleans() { return bools; }
-
-	public byte getByte() { return b; }
-
-	public byte[] getBytes() { return bs; }
-
-	public char getChar() { return c; }
-
-	public char[] getChars() { return cs; }
-
-	public double getDouble() { return d; }
-
-	public double[] getDoubles() { return ds; }
-
-	public float getFloat() { return f; }
-
-	public float[] getFloats() { return fs; }
-
-	public int getInt() { return i; }
-
-	public int[] getInts() { return is; }
-
-	public long getLong() { return l; }
-
-	public long[] getLongs() { return ls; }
-
-	public short getShort() { return s; }
-
-	public short[] getShorts() { return ss; }
-
-	public void setBoolean(boolean b) { this.bool = b; }
-
-	public void setBooleans(boolean[] bs) { this.bools = bs; }
-
-	public void setByte(byte b) { this.b = b; }
-
-	public void setBytes(byte[] bs) { this.bs = bs; }
-
-	public void setChar(char c) { this.c = c; }
-
-	public void setChars(char[] cs) { this.cs = cs; }
-
-	public void setDouble(double d) { this.d = d; }
-
-	public void setDoubles(double[] ds) { this.ds = ds; }
-
-	public void setFloat(float f) { this.f = f; }
-
-	public void setFloats(float[] fs) { this.fs = fs; }
-
-	public void setInt(int i) { this.i = i; }
-
-	public void setInts(int[] is) { this.is = is; }
-
-	public void setLong(long l) { this.l = l; }
-
-	public void setLongs(long[] ls) { this.ls = ls; }
-
- 	public void setShort(short s) { this.s = s; }
-
-	public void setShorts(short[] ss) {
-	    this.ss = new short[ss.length];
-	    for (int i = 0; i < ss.length; i++) {
-	        this.ss[i] = ss[i];
-	    }
-	}	
-	
-	// This method has been added to test an issue when autoboxing.
-	public void setLong(long l, String s) {
-	    this.l = l;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
deleted file mode 100644
index e8116d2..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/ManipulationTestSuite.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import junit.framework.Test;
-
-import org.apache.felix.ipojo.junit4osgi.OSGiTestSuite;
-import org.osgi.framework.BundleContext;
-
-public class ManipulationTestSuite {
-
-	public static Test suite(BundleContext bc) {
-		OSGiTestSuite ots = new OSGiTestSuite("Primitive Manipulation Test Suite", bc);
-		ots.addTestSuite(PrimitiveTypeTest.class);
-		ots.addTestSuite(PrimitiveTypeTest2.class);
-		return ots;
-	}
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
deleted file mode 100644
index c6907cd..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest.java
+++ /dev/null
@@ -1,97 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-
-/**
- * Check the manipulation of primitive type (boxed and unboxed).
- */
-public class PrimitiveTypeTest extends OSGiTestCase {
-
-	PrimitiveManipulationTestService prim;
-	
-	IPOJOHelper helper;
-	
-	public void setUp() {
-	    helper = new IPOJOHelper(this);
-	    ComponentInstance instance = helper.createComponentInstance("ManipulationPrimitives-PrimitiveManipulationTester");
-		assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
-		prim = (PrimitiveManipulationTestService) getServiceObject(PrimitiveManipulationTestService.class.getName(), "(instance.name=" + instance.getInstanceName() + ")");
-		assertNotNull("Check prim availability", prim);
-	}
-	
-	public void tearDown() {
-	    helper.dispose();
-		prim = null;
-	}
-	
-	public void testByte() {
-		assertEquals("Check - 1", prim.getByte(), 1);
-		prim.setByte((byte) 2);
-		assertEquals("Check - 2", prim.getByte(), 2);
-	}
-	
-	public void testShort() {
-		assertEquals("Check - 1", prim.getShort(), 1);
-		prim.setShort((short) 2);
-		assertEquals("Check - 2", prim.getShort(), 2);
-	}
-	
-	public void testInt() {
-		assertEquals("Check - 1", prim.getInt(), 1);
-		prim.setInt((int) 2);
-		assertEquals("Check - 2", prim.getInt(), 2);
-	}
-	
-	public void testLong() {
-		assertEquals("Check - 1", prim.getLong(), 1);
-		prim.setLong((long) 2);
-		assertEquals("Check - 2", prim.getLong(), 2);
-	}
-	
-	public void testFloat() {
-		assertEquals("Check - 1", prim.getFloat(), 1.1f);
-		prim.setFloat(2.2f);
-		assertEquals("Check - 2", prim.getFloat(), 2.2f);
-	}
-	
-	public void testDouble() {
-		assertEquals("Check - 1", prim.getDouble(), 1.1);
-		prim.setDouble(2.2);
-		assertEquals("Check - 2", prim.getDouble(), 2.2);
-	}
-	
-	public void testBoolean() {
-		assertFalse("Check - 1", prim.getBoolean());
-		prim.setBoolean(true);
-		assertTrue("Check - 2", prim.getBoolean());
-	}
-	
-	public void testChar() {
-		assertEquals("Check - 1", prim.getChar(), 'a');
-		prim.setChar('b');
-		assertEquals("Check - 2", prim.getChar(), 'b');
-	}
-	
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
deleted file mode 100644
index 81b99a7..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/PrimitiveTypeTest2.java
+++ /dev/null
@@ -1,106 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.junit4osgi.OSGiTestCase;
-import org.apache.felix.ipojo.junit4osgi.helpers.IPOJOHelper;
-import org.apache.felix.ipojo.test.scenarios.manipulation.service.PrimitiveManipulationTestService;
-import org.osgi.framework.ServiceReference;
-
-/**
- * Check the manipulation of primitive type (boxed and unboxed).
- * The targeted implementation contains numbers.
- */
-public class PrimitiveTypeTest2 extends OSGiTestCase {
-
-    PrimitiveManipulationTestService prim;
-    IPOJOHelper helper;
-    
-    public void setUp() {
-        helper = new IPOJOHelper(this);
-        ComponentInstance instance = helper.createComponentInstance("ManipulationPrimitives-PrimitiveManipulationTesterA");
-        assertTrue("check instance state", instance.getState() == ComponentInstance.VALID);
-        ServiceReference ref = helper.getServiceReferenceByName(PrimitiveManipulationTestService.class.getName(), instance.getInstanceName());
-        assertNotNull("Check prim availability", ref);
-        prim = (PrimitiveManipulationTestService) getServiceObject(ref);
-    }
-
-    public void tearDown() {
-        prim = null;
-        helper.dispose();
-    }
-
-    public void testByte() {
-        assertEquals("Check - 1", prim.getByte(), 1);
-        prim.setByte((byte) 2);
-        assertEquals("Check - 2", prim.getByte(), 2);
-    }
-
-    public void testShort() {
-        assertEquals("Check - 1", prim.getShort(), 1);
-        prim.setShort((short) 2);
-        assertEquals("Check - 2", prim.getShort(), 2);
-    }
-
-    public void testInt() {
-        assertEquals("Check - 1", prim.getInt(), 1);
-        prim.setInt((int) 2);
-        assertEquals("Check - 2", prim.getInt(), 2);
-    }
-
-    public void testLong() {
-        assertEquals("Check - 1", prim.getLong(), 1);
-        prim.setLong((long) 2);
-        assertEquals("Check - 2", prim.getLong(), 2);
-    }
-
-    public void testLong2() {
-        assertEquals("Check - 1", prim.getLong(), 1);
-        prim.setLong(2, "ss");
-        assertEquals("Check - 2", prim.getLong(), 2);
-    }
-
-
-
-    public void testFloat() {
-        assertEquals("Check - 1", prim.getFloat(), 1.1f);
-        prim.setFloat(2.2f);
-        assertEquals("Check - 2", prim.getFloat(), 2.2f);
-    }
-
-    public void testDouble() {
-        assertEquals("Check - 1", prim.getDouble(), 1.1);
-        prim.setDouble(2.2);
-        assertEquals("Check - 2", prim.getDouble(), 2.2);
-    }
-
-    public void testBoolean() {
-        assertFalse("Check - 1", prim.getBoolean());
-        prim.setBoolean(true);
-        assertTrue("Check - 2", prim.getBoolean());
-    }
-
-    public void testChar() {
-        assertEquals("Check - 1", prim.getChar(), 'a');
-        prim.setChar('b');
-        assertEquals("Check - 2", prim.getChar(), 'b');
-    }
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
deleted file mode 100644
index 5f5b74b..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/A123/CheckService2.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service.A123;
-
-public interface CheckService2 {
-	
-	public boolean check();
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
deleted file mode 100644
index dfe2b9c..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/BarService.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface BarService {
-	
-	public boolean bar();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
deleted file mode 100644
index ef7e1ee..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/CheckService.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface CheckService {
-    
-    public static final String foo = "foo";
-	
-	public boolean check();
-	
-	public Properties getProps();
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
deleted file mode 100644
index f1e8dc0..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/FooService.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-import java.util.Properties;
-
-public interface FooService {
-
-	boolean foo();
-	
-	Properties fooProps();
-	
-	Boolean getObject();
-	
-	boolean getBoolean();
-	
-	int getInt();
-	
-	long getLong();
-	
-	double getDouble();
-	
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
deleted file mode 100644
index 1bb177c..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/Plop.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface Plop {
-    
-   Object getPlop();
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
deleted file mode 100644
index cd61e3b..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/manipulation/service/PrimitiveManipulationTestService.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.manipulation.service;
-
-public interface PrimitiveManipulationTestService {
-	
-	byte getByte();
-	void setByte(byte b);
-	
-	short getShort();
-	void setShort(short s);
-	
-	int getInt();
-	void setInt(int i);
-	
-	long getLong();
-	void setLong(long l);
-	
-	float getFloat();
-	void setFloat(float f);
-	
-	double getDouble();
-	void setDouble(double d);
-	
-	char getChar();
-	void setChar(char c);
-	
-	boolean getBoolean();
-	void setBoolean(boolean b);
-	
-	// Array types
-	byte[] getBytes();
-	void setBytes(byte[] bs);
-	
-	short[] getShorts();
-	void setShorts(short[] ss);
-	
-	int[] getInts();
-	void setInts(int is[]);
-	
-	long[] getLongs();
-	void setLongs(long[] ls);
-	
-	float[] getFloats();
-	void setFloats(float[] fs);
-	
-	double[] getDoubles();
-	void setDoubles(double[] ds);
-	
-	char[] getChars();
-	void setChars(char[] cs);
-	
-	boolean[] getBooleans();
-	void setBooleans(boolean[] bs);	
-	
-	// This method has been added to test an issue when autoboxing.
-	void setLong(long l, String s);
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java b/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
deleted file mode 100644
index bcec3d5..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/java/org/apache/felix/ipojo/test/scenarios/util/Utils.java
+++ /dev/null
@@ -1,329 +0,0 @@
-/* 
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.ipojo.test.scenarios.util;
-
-import java.util.Dictionary;
-import java.util.Properties;
-
-import junit.framework.Assert;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.Factory;
-import org.apache.felix.ipojo.Handler;
-import org.apache.felix.ipojo.HandlerManagerFactory;
-import org.apache.felix.ipojo.ServiceContext;
-import org.apache.felix.ipojo.architecture.Architecture;
-//import org.apache.felix.ipojo.composite.CompositeManager;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.cm.ManagedServiceFactory;
-
-public class Utils {
-
-    public static Factory getFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static HandlerManagerFactory getHandlerFactoryByName(BundleContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(" + Handler.HANDLER_NAME_PROPERTY + "=" + factoryName + ")");
-            if (refs == null) {
-                System.err.println("Cannot get the factory " + factoryName);
-                return null;
-            }
-            return (HandlerManagerFactory) bc.getService(refs[0]);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(BundleContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        // if(fact.isAcceptable(configuration)) {
-        try {
-            return fact.createComponentInstance(configuration);
-        } catch (Exception e) {
-            e.printStackTrace();
-            Assert.fail("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-        // }
-        // else {
-        // System.err.println("Configuration not accepted by : " + factoryName);
-        // return null;
-        // }
-    }
-
-    public static ComponentInstance getComponentInstanceByName(BundleContext bc, String factoryName, String name) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) {
-            System.err.println("Factory " + factoryName + " not found");
-            return null;
-        }
-
-        try {
-            Properties props = new Properties();
-            props.put("instance.name",name);
-            return fact.createComponentInstance(props);
-        } catch (Exception e) {
-            System.err.println("Cannot create the instance from " + factoryName + " : " + e.getMessage());
-            e.printStackTrace();
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(BundleContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else if (itf.equals(Architecture.class.getName())) {
-            filter = "(" + "architecture.instance" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-    
-    public static ServiceReference getServiceReferenceByPID(BundleContext bc, String itf, String pid) {
-        ServiceReference[] refs = null;
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            Assert.fail("A service lookup by PID returned several providers (" + refs.length + ")" + " for " + itf + " with " + pid);
-            return null;
-        }
-    }
-
-    public static Object getServiceObject(BundleContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(BundleContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-//    public static ServiceContext getServiceContext(ComponentInstance ci) {
-//        if (ci instanceof CompositeManager) {
-//            return ((CompositeManager) ci).getServiceContext();
-//        } else {
-//            throw new RuntimeException("Cannot get the service context form an non composite instance");
-//        }
-//    }
-
-    public static Factory getFactoryByName(ServiceContext bc, String factoryName) {
-        ServiceReference[] refs;
-        try {
-            refs = bc.getServiceReferences(Factory.class.getName(), "(factory.name=" + factoryName + ")");
-            if (refs == null) { return null; }
-            return ((Factory) bc.getService(refs[0]));
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Cannot get the factory " + factoryName + " : " + e.getMessage());
-            return null;
-        }
-    }
-
-    public static ComponentInstance getComponentInstance(ServiceContext bc, String factoryName, Dictionary configuration) {
-        Factory fact = getFactoryByName(bc, factoryName);
-
-        if (fact == null) { return null; }
-
-        if (fact.isAcceptable(configuration)) {
-            try {
-                return fact.createComponentInstance(configuration);
-            } catch (Exception e) {
-                System.err.println(e.getMessage());
-                e.printStackTrace();
-                return null;
-            }
-        } else {
-            System.err.println("Configuration not accepted by : " + factoryName);
-            return null;
-        }
-    }
-
-    public static ServiceReference[] getServiceReferences(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    public static ServiceReference getServiceReference(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static ServiceReference getServiceReferenceByName(ServiceContext bc, String itf, String name) {
-        ServiceReference[] refs = null;
-        String filter = null;
-        if (itf.equals(Factory.class.getName()) || itf.equals(ManagedServiceFactory.class.getName())) {
-            filter = "(" + "factory.name" + "=" + name + ")";
-        } else {
-            filter = "(" + "instance.name" + "=" + name + ")";
-        }
-        try {
-            refs = bc.getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            System.err.println("Invalid Filter : " + filter);
-        }
-        if (refs == null) {
-            return null;
-        } else {
-            return refs[0];
-        }
-    }
-
-    public static Object getServiceObject(ServiceContext bc, String itf, String filter) {
-        ServiceReference ref = getServiceReference(bc, itf, filter);
-        if (ref != null) {
-            return bc.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    public static Object[] getServiceObjects(ServiceContext bc, String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bc, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bc.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-    
-    public static boolean contains(String string, String[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] != null  && array[i].equals(string)) {
-                return true;
-            }
-        }
-        return false;
-    }
-    
-    public static boolean contains(int value, int[] array) {
-        for (int i = 0; array != null && i < array.length; i++) {
-            if (array[i] == value) {
-                return true;
-            }
-        }
-        return false;
-    }
-
-}
diff --git a/ipojo/tests/manipulator/primitives/src/main/resources/metadata.xml b/ipojo/tests/manipulator/primitives/src/main/resources/metadata.xml
deleted file mode 100644
index b66c91b..0000000
--- a/ipojo/tests/manipulator/primitives/src/main/resources/metadata.xml
+++ /dev/null
@@ -1,22 +0,0 @@
-<ipojo
-    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
-    xmlns="org.apache.felix.ipojo"
->
-	
-	<!-- Manipulation -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.Manipulation23Tester"
-		name="ManipulationPrimitives-PrimitiveManipulationTester" architecture="true">
-		<provides />
-	</component>
-
-	<!-- Manipulation with numbers -->
-	<component
-		classname="org.apache.felix.ipojo.test.scenarios.component.A123.Manipulation23Tester"
-		name="ManipulationPrimitives-PrimitiveManipulationTesterA" architecture="true">
-		<provides />
-	</component>
-	
-
-</ipojo>
diff --git a/ipojo/tests/online-manipulator/pom.xml b/ipojo/tests/online-manipulator/pom.xml
deleted file mode 100644
index 8e8ae03..0000000
--- a/ipojo/tests/online-manipulator/pom.xml
+++ /dev/null
@@ -1,106 +0,0 @@
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-
-    <parent>
-        <groupId>ipojo.tests</groupId>
-        <artifactId>ipojo.tests</artifactId>
-        <version>1.5.0-SNAPSHOT</version>
-        <relativePath>../pom.xml</relativePath>
-    </parent>
-
-    <groupId>org.apache.felix</groupId>
-    <artifactId>org.apache.felix.ipojo.online.manipulator.test</artifactId>
-    <version>1.7.0-SNAPSHOT</version>
-    <name>Online Manipulator Test</name>
-    <packaging>jar</packaging>
-    <build>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <source>1.5</source>
-                    <target>1.5</target>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.servicemix.tooling</groupId>
-                <artifactId>depends-maven-plugin</artifactId>
-                <version>1.2</version>
-                <executions>
-                    <execution>
-                        <id>generate-depends-file</id>
-                        <goals>
-                            <goal>generate-depends-file</goal>
-                        </goals>
-                    </execution>
-                </executions>
-            </plugin>
-        </plugins>
-    </build>
-
-    <dependencies>
-        <dependency>
-            <groupId>org.osgi</groupId>
-            <artifactId>org.osgi.core</artifactId>
-        </dependency>
-
-        <!--
-          Pax Exam API:
-        -->
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam</artifactId>
-            <version>1.2.0</version>
-        </dependency>
-        <!--
-          During runtime Pax Exam will discover the OSGi container to use by
-          searching metadata available into classpath. Pax Exam comes with a
-          default container that uses [Pax Runner] for implementing the
-          container requirements:
-        -->
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-container-default
-            </artifactId>
-            <version>1.2.0</version>
-        </dependency>
-        <!--
-          If your test code is based on JUnit you will have to have the Junit
-          support artifact:
-        -->
-        <dependency>
-            <groupId>org.ops4j.pax.exam</groupId>
-            <artifactId>pax-exam-junit</artifactId>
-            <version>1.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>junit</groupId>
-            <artifactId>junit</artifactId>
-            <version>4.5</version>
-            <type>jar</type>
-            <scope>test</scope>
-        </dependency>
-
-        <dependency>
-            <groupId>org.ops4j.pax.swissbox</groupId>
-            <artifactId>pax-swissbox-tinybundles</artifactId>
-            <version>1.2.0</version>
-        </dependency>
-        <dependency>
-            <groupId>xerces</groupId>
-            <artifactId>xercesImpl</artifactId>
-            <version>2.4.0</version>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-        </dependency>
-        <dependency>
-            <groupId>org.apache.felix</groupId>
-            <artifactId>org.apache.felix.ipojo</artifactId>
-            <version>${ipojo.core.snapshot}</version>
-        </dependency>
-    </dependencies>
-</project>
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
deleted file mode 100644
index d8c639e..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OSGiHelper.java
+++ /dev/null
@@ -1,456 +0,0 @@
-package org.apache.felix.ipojo.online.manipulator.test;
-
-import static org.junit.Assert.fail;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.packageadmin.PackageAdmin;
-
-
-public class OSGiHelper {
-    
-    /**
-     * The bundle context.
-     */
-    private BundleContext context;
-    
-    /**
-     * List of get references.
-     */
-    private List<ServiceReference> m_references = new ArrayList<ServiceReference>();
-    
-    public OSGiHelper(BundleContext context) {
-        this.context = context;
-    }
-    
-    public void dispose() {
-        // Unget services
-        for (int i = 0; i < m_references.size(); i++) {
-            context.ungetService((ServiceReference) m_references.get(i));
-        }
-        m_references.clear();
-    }
-    
-    /**
-     * Gets the Bundle Context.
-     * @return the bundle context.
-     */
-    public BundleContext getContext() {
-        return context;
-    }
-    
-    /**
-     * Returns the service object of a service provided by the specified bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service object provided by the specified bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public static Object getServiceObject(Bundle bundle, String itf,
-            String filter) {
-        ServiceReference ref = getServiceReference(bundle, itf, filter);
-        if (ref != null) {
-            return bundle.getBundleContext().getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service objects of the services provided by the specified
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service objects provided by the specified bundle, offering
-     *         the specified interface and matching the given filter.
-     */
-    public static Object[] getServiceObjects(Bundle bundle, String itf,
-            String filter) {
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                list[i] = bundle.getBundleContext().getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    /**
-     * Returns the service reference of a service provided by the specified
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return a service reference provided by the specified bundle, offering
-     *         the specified interface and matching the given filter. If no
-     *         service is found, {@code null} is returned.
-     */
-    public static ServiceReference getServiceReference(Bundle bundle,
-            String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs.length != 0) {
-            return refs[0];
-        } else {
-            // No service found
-            return null;
-        }
-    }
-
-    /**
-     * Checks if the service is available.
-     * @param itf the service interface
-     * @return <code>true</code> if the service is available, <code>false</code>
-     *         otherwise.
-     */
-    public boolean isServiceAvailable(String itf) {
-        ServiceReference ref = getServiceReference(itf, null);
-        return ref != null;
-    }
-
-    /**
-     * Checks if the service is available.
-     * @param itf the service interface
-     * @param pid the service pid
-     * @return <code>true</code> if the service is available, <code>false</code>
-     *         otherwise.
-     */
-    public boolean isServiceAvailableByPID(String itf, String pid) {
-        ServiceReference ref = getServiceReferenceByPID(itf, pid);
-        return ref != null;
-    }
-
-    /**
-     * Returns the service reference of the service provided by the specified
-     * bundle, offering the specified interface and having the given persistent
-     * ID.
-     * 
-     * @param bundle the bundle from which the service is searched.
-     * @param itf the interface provided by the searched service.
-     * @param pid the persistent ID of the searched service.
-     * @return a service provided by the specified bundle, offering the
-     *         specified interface and having the given persistent ID.
-     */
-    public static ServiceReference getServiceReferenceByPID(Bundle bundle,
-            String itf, String pid) {
-        String filter = "(" + "service.pid" + "=" + pid + ")";
-        ServiceReference[] refs = getServiceReferences(bundle, itf, filter);
-        if (refs == null) {
-            return null;
-        } else if (refs.length == 1) {
-            return refs[0];
-        } else {
-            throw new IllegalStateException(
-                    "A service lookup by PID returned several providers ("
-                            + refs.length + ")" + " for " + itf + " with pid="
-                            + pid);
-        }
-    }
-
-    /**
-     * Returns the service reference of all the services provided in the
-     * specified bundle, offering the specified interface and matching the given
-     * filter.
-     * 
-     * @param bundle the bundle from which services are searched.
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return all the service references provided in the specified bundle,
-     *         offering the specified interface and matching the given filter.
-     *         If no service matches, an empty array is returned.
-     */
-    public static ServiceReference[] getServiceReferences(Bundle bundle,
-            String itf, String filter) {
-        ServiceReference[] refs = null;
-        try {
-            // Get all the service references
-            refs = bundle.getBundleContext().getServiceReferences(itf, filter);
-        } catch (InvalidSyntaxException e) {
-            throw new IllegalArgumentException(
-                    "Cannot get service references: " + e.getMessage());
-        }
-        if (refs == null) {
-            return new ServiceReference[0];
-        } else {
-            return refs;
-        }
-    }
-
-    /**
-     * Returns the service object of a service provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service object provided by the local bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public Object getServiceObject(String itf, String filter) {
-        ServiceReference ref = getServiceReference(itf, filter);
-        if (ref != null) {
-            m_references.add(ref);
-            return context.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service object associated with this service reference.
-     * 
-     * @param ref service reference
-     * @return the service object.
-     */
-    public Object getServiceObject(ServiceReference ref) {
-        if (ref != null) {
-            m_references.add(ref);
-            return context.getService(ref);
-        } else {
-            return null;
-        }
-    }
-
-    /**
-     * Returns the service objects of the services provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return the service objects provided by the local bundle, offering the
-     *         specified interface and matching the given filter.
-     */
-    public Object[] getServiceObjects(String itf, String filter) {
-        ServiceReference[] refs = getServiceReferences(itf, filter);
-        if (refs != null) {
-            Object[] list = new Object[refs.length];
-            for (int i = 0; i < refs.length; i++) {
-                m_references.add(refs[i]);
-                list[i] = context.getService(refs[i]);
-            }
-            return list;
-        } else {
-            return new Object[0];
-        }
-    }
-
-    /**
-     * Returns the service reference of a service provided by the local bundle,
-     * offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param filter an additional filter (can be {@code null}).
-     * @return a service reference provided by the local bundle, offering the
-     *         specified interface and matching the given filter. If no service
-     *         is found, {@code null} is returned.
-     */
-    public ServiceReference getServiceReference(String itf, String filter) {
-        return getServiceReference(context.getBundle(), itf, filter);
-    }
-
-    /**
-     * Returns the service reference of a service provided offering the
-     * specified interface.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @return a service reference provided by the local bundle, offering the
-     *         specified interface and matching the given filter. If no service
-     *         is found, {@code null} is returned.
-     */
-    public ServiceReference getServiceReference(String itf) {
-        return getServiceReference(context.getBundle(), itf, null);
-    }
-
-    /**
-     * Returns the service reference of the service provided by the local
-     * bundle, offering the specified interface and having the given persistent
-     * ID.
-     * 
-     * @param itf the interface provided by the searched service.
-     * @param pid the persistent ID of the searched service.
-     * @return a service provided by the local bundle, offering the specified
-     *         interface and having the given persistent ID.
-     */
-    public ServiceReference getServiceReferenceByPID(String itf, String pid) {
-        return getServiceReferenceByPID(context.getBundle(), itf, pid);
-    }
-
-    /**
-     * Returns the service reference of all the services provided in the local
-     * bundle, offering the specified interface and matching the given filter.
-     * 
-     * @param itf the interface provided by the searched services.
-     * @param filter an additional filter (can be {@code null}).
-     * @return all the service references provided in the local bundle, offering
-     *         the specified interface and matching the given filter. If no
-     *         service matches, an empty array is returned.
-     */
-    public ServiceReference[] getServiceReferences(String itf, String filter) {
-        return getServiceReferences(context.getBundle(), itf, filter);
-    }
-    
-    /**
-     * Gets the package admin exposed by the framework.
-     * Fails if the package admin is not available. 
-     * @return the package admin service.
-     */
-    public PackageAdmin getPackageAdmin() {
-        PackageAdmin pa = (PackageAdmin) getServiceObject(PackageAdmin.class.getName(), null);
-        if (pa == null) {
-            fail("No package admin available");
-        }
-        return pa;
-    }
-    
-    /**
-     * Refresh the packages.
-     * Fails if the package admin service is not available.
-     */
-    public void refresh() {
-        getPackageAdmin().refreshPackages(null);
-    }
-    
-    /**
-     * Waits for a service. Fails on timeout.
-     * If timeout is set to 0, it sets the timeout to 10s.
-     * @param itf the service interface
-     * @param filter  the filter
-     * @param timeout the timeout
-     */
-    public void waitForService(String itf, String filter, long timeout) {
-        if (timeout == 0) {
-            timeout = 10000; // Default 10 secondes.
-        }
-        ServiceReference[] refs = getServiceReferences(itf, filter);
-        long begin = System.currentTimeMillis();
-        if (refs.length != 0) {
-            return;
-        } else {
-            while(refs.length == 0) {
-                try {
-                    Thread.sleep(5);
-                } catch (InterruptedException e) {
-                    // Interrupted
-                }
-                long now = System.currentTimeMillis();
-                
-                if ((now - begin) > timeout) {
-                    fail("Timeout ... no services matching with the request after " + timeout + "ms");
-                }
-                refs = getServiceReferences(itf, filter);
-            }
-        }
-    }
-    
-    
-    /**
-     * Installs a bundle.
-     * Fails if the bundle cannot be installed.
-     * Be aware that you have to uninstall the bundle yourself.
-     * @param url bundle url
-     * @return the installed bundle
-     */
-    public Bundle installBundle(String url) {
-        try {
-            return context.installBundle(url);
-        } catch (BundleException e) {
-            fail("Cannot install the bundle " + url + " : " + e.getMessage());
-        }
-        return null; // Can not happen
-    }
-    
-    /**
-     * Installs a bundle.
-     * Fails if the bundle cannot be installed.
-     * Be aware that you have to uninstall the bundle yourself.
-     * @param url bundle url
-     * @param stream input stream containing the bundle
-     * @return the installed bundle
-     */
-    public Bundle installBundle(String url, InputStream stream) {
-        try {
-            return context.installBundle(url, stream);
-        } catch (BundleException e) {
-            fail("Cannot install the bundle " + url + " : " + e.getMessage());
-        }
-        return null; // Can not happen
-    }
-    
-    /**
-     * Installs and starts a bundle.
-     * Fails if the bundle cannot be installed or an error occurs
-     * during startup. Be aware that you have to uninstall the bundle
-     * yourself.
-     * @param url the bundle url
-     * @return the Bundle object.
-     */
-    public Bundle installAndStart(String url) {
-        Bundle bundle = installBundle(url);
-        try {
-            bundle.start();
-        } catch (BundleException e) {
-           fail("Cannot start the bundle " + url + " : " + e.getMessage());
-        }
-        return bundle;
-    }
-    
-    /**
-     * Installs and starts a bundle.
-     * Fails if the bundle cannot be installed or an error occurs
-     * during startup. Be aware that you have to uninstall the bundle
-     * yourself.
-     * @param url the bundle url
-     * @param stream input stream containing the bundle
-     * @return the Bundle object.
-     */
-    public Bundle installAndStart(String url, InputStream stream) {
-        Bundle bundle = installBundle(url, stream);
-        try {
-            bundle.start();
-        } catch (BundleException e) {
-           fail("Cannot start the bundle " + url + " : " + e.getMessage());
-        }
-        return bundle;
-    }
-    
-    /**
-     * Get the bundle by its id.
-     * @param bundleId the bundle id.
-     * @return the bundle with the given id.
-     */
-    public Bundle getBundle(long bundleId) {
-        return context.getBundle(bundleId);
-    }
-    
-    /**
-     * Gets a bundle by its symbolic name.
-     * Fails if no bundle matches.
-     * @param name the symbolic name of the bundle
-     * @return the bundle object.
-     */
-    public Bundle getBundle(String name) {
-        Bundle[] bundles = context.getBundles();
-        for (int i = 0; i < bundles.length; i++) {
-            if (name.equals(bundles[i].getSymbolicName())) {
-                return bundles[i];
-            }
-        }
-        fail("No bundles with the given symbolic name " + name);
-        return null; // should not happen
-    }
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
deleted file mode 100644
index 11ae242..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/OnlineManipulatorTest.java
+++ /dev/null
@@ -1,360 +0,0 @@
-package org.apache.felix.ipojo.online.manipulator.test;
-
-
-import static org.ops4j.pax.exam.CoreOptions.*;
-import static org.ops4j.pax.exam.MavenUtils.asInProject;
-import static org.ops4j.pax.swissbox.tinybundles.core.TinyBundles.newBundle;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.felix.ipojo.ComponentInstance;
-import org.apache.felix.ipojo.architecture.Architecture;
-import org.apache.felix.ipojo.architecture.InstanceDescription;
-import org.apache.felix.ipojo.test.online.components.Consumer;
-import org.apache.felix.ipojo.test.online.components.MyProvider;
-import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.ops4j.io.StreamUtils;
-import org.ops4j.pax.exam.Customizer;
-import org.ops4j.pax.exam.Inject;
-import org.ops4j.pax.exam.Option;
-import org.ops4j.pax.exam.junit.Configuration;
-import org.ops4j.pax.exam.junit.JUnit4TestRunner;
-import org.ops4j.pax.swissbox.tinybundles.core.TinyBundles;
-import org.osgi.framework.Bundle;
-import org.osgi.framework.BundleContext;
-import org.osgi.framework.BundleException;
-import org.osgi.framework.Constants;
-import org.osgi.framework.InvalidSyntaxException;
-import org.osgi.framework.ServiceReference;
-
-
-@RunWith(JUnit4TestRunner.class)
-public class OnlineManipulatorTest {
-
-
-    private static File TMP = new File("target/tmp-bundle");
-
-    @Inject
-    BundleContext context;
-
-    private OSGiHelper helper;
-
-
-    /*
-     * <groupId>org.apache.felix</groupId>
-  <artifactId>org.apache.felix.ipojo.online.manipulator</artifactId>
-  <version>1.3.0-SNAPSHOT</version>
-
-     */
-
-    @Configuration
-    public static Option[] configure() throws IOException {
-
-
-        String providerWithMetadata = providerWithMetadata();
-        String providerWithMetadataInMetaInf = providerWithMetadataInMetaInf();
-        String providerWithoutMetadata = providerWithoutMetadata();
-        String consumerWithMetadata = consumerWithMetadata();
-        String consumerWithoutMetadata = consumerWithoutMetadata();
-
-        return options(
-                frameworks(
-                        felix(),
-                        equinox(),
-                        knopflerfish() //KF does not export an XML parser.
-                ),
-                provision(
-                        mavenBundle()
-                                .groupId("org.apache.felix")
-                                .artifactId("org.apache.felix.ipojo")
-                                .version(asInProject())
-                ),
-
-                provision(
-                        newBundle()
-                                .add(Hello.class)
-                                .set(Constants.BUNDLE_SYMBOLICNAME, "ServiceInterface")
-                                .set(Constants.EXPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                                .build()
-                ),
-                systemProperty("providerWithMetadata").value(providerWithMetadata),
-                systemProperty("providerWithMetadataInMetaInf").value(providerWithMetadataInMetaInf),
-                systemProperty("providerWithoutMetadata").value(providerWithoutMetadata),
-                systemProperty("consumerWithMetadata").value(consumerWithMetadata),
-                systemProperty("consumerWithoutMetadata").value(consumerWithoutMetadata),
-
-                new Customizer() {
-                    @Override
-                    public InputStream customizeTestProbe(InputStream testProbe) {
-                        return TinyBundles.modifyBundle(testProbe).set(Constants.IMPORT_PACKAGE,
-                                "org.apache.felix.ipojo.online.manipulator.test.service")
-                                .build();
-                    }
-
-                }
-        );
-
-    }
-
-    @Before
-    public void before() {
-        helper = new OSGiHelper(context);
-    }
-
-    @After
-    public void after() {
-        helper.dispose();
-    }
-
-    private static File getTemporaryFile(String name) throws IOException {
-        if (!TMP.exists()) {
-            TMP.mkdirs();
-            TMP.deleteOnExit();
-        }
-        File file = File.createTempFile(name, ".jar", TMP);
-        //File file = new File(TMP, name + ".jar");
-        if (file.exists()) {
-            file.delete();
-        }
-        file.deleteOnExit();
-        return file;
-    }
-
-    @Test
-    public void installProviderWithMetadata1() throws BundleException, InvalidSyntaxException, Exception {
-        String url = context.getProperty("providerWithMetadata");
-        Assert.assertNotNull(url);
-        Bundle bundle = context.installBundle("ipojo:" + url);
-        bundle.start();
-
-        assertBundle("Provider");
-
-        helper.waitForService(Hello.class.getName(), null, 5000);
-        assertValidity();
-        Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
-    }
-
-
-    @Test
-    public void installProviderWithMetadata2() throws BundleException, InvalidSyntaxException, IOException {
-        String url = context.getProperty("providerWithMetadataInMetaInf");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url).start();
-        assertBundle("Provider");
-        helper.waitForService(Hello.class.getName(), null, 5000);
-        assertValidity();
-        Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
-    }
-
-    @Test
-    public void installProviderWithoutMetadata() throws BundleException, InvalidSyntaxException, IOException {
-        String url = context.getProperty("providerWithoutMetadata");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url).start();
-        assertBundle("Provider");
-        helper.waitForService(Hello.class.getName(), null, 5000);
-        assertValidity();
-        Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
-    }
-
-    @Test
-    public void installConsumerWithMetadata() throws BundleException, InvalidSyntaxException, IOException {
-        String url = context.getProperty("providerWithoutMetadata");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url).start();
-        assertBundle("Provider");
-
-        String url2 = context.getProperty("consumerWithMetadata");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url2).start();
-        assertBundle("Consumer");
-        helper.waitForService(Hello.class.getName(), null, 5000);
-        // Wait for activation.
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        assertValidity();
-        Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
-    }
-
-    @Test
-    public void installConsumerWithoutMetadata() throws BundleException, InvalidSyntaxException, IOException {
-        String url = context.getProperty("providerWithMetadataInMetaInf");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url).start();
-        assertBundle("Provider");
-        helper.waitForService(Hello.class.getName(), null, 5000);
-
-        String url2 = context.getProperty("consumerWithoutMetadata");
-        Assert.assertNotNull(url);
-        context.installBundle("ipojo:" + url2).start();
-        assertBundle("Consumer");
-        // Wait for activation.
-        try {
-            Thread.sleep(2000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();
-        }
-        assertValidity();
-        Assert.assertNotNull(context.getServiceReference(Hello.class.getName()));
-    }
-
-    /**
-     * Gets a regular bundle containing metadata file
-     *
-     * @return the url of the bundle
-     * @throws IOException
-     */
-    public static String providerWithMetadata() throws IOException {
-        InputStream is = newBundle()
-                .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml"))
-                .add(MyProvider.class)
-                .set(Constants.BUNDLE_SYMBOLICNAME, "Provider")
-                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                .build();
-
-        File out = getTemporaryFile("providerWithMetadata");
-        StreamUtils.copyStream(is, new FileOutputStream(out), true);
-        return out.toURI().toURL().toExternalForm();
-    }
-
-    /**
-     * Gets a regular bundle containing metadata file in the META-INF directory
-     *
-     * @return the url of the bundle
-     * @throws IOException
-     */
-    public static String providerWithMetadataInMetaInf() throws IOException {
-        InputStream is = newBundle()
-                .add("META-INF/metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml"))
-                .add(MyProvider.class)
-                .set(Constants.BUNDLE_SYMBOLICNAME, "Provider")
-                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                .build();
-
-        File out = getTemporaryFile("providerWithMetadataInMetaInf");
-        StreamUtils.copyStream(is, new FileOutputStream(out), true);
-        return out.toURI().toURL().toExternalForm();
-    }
-
-    /**
-     * Gets a provider bundle which does not contain the metadata file.
-     *
-     * @return the url of the bundle + metadata
-     * @throws IOException
-     */
-    public static String providerWithoutMetadata() throws IOException {
-        InputStream is = newBundle()
-                //.addResource("metadata.xml", this.getClass().getClassLoader().getResource("provider.xml"))
-                .add(MyProvider.class)
-                .set(Constants.BUNDLE_SYMBOLICNAME, "Provider")
-                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                .build();
-
-        File out = getTemporaryFile("providerWithoutMetadata");
-        StreamUtils.copyStream(is, new FileOutputStream(out), true);
-        String url = out.toURI().toURL().toExternalForm();
-
-        return url + "!" + OnlineManipulatorTest.class.getClassLoader().getResource("provider.xml");
-    }
-
-    /**
-     * Gets a consumer bundle using annotation containing the instance
-     * declaration in the metadata.
-     *
-     * @return the url of the bundle
-     * @throws IOException
-     */
-    public static String consumerWithMetadata() throws IOException {
-        InputStream is = newBundle()
-                .add("metadata.xml", OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml"))
-                .add(Consumer.class)
-                .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer")
-                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                .build();
-
-        File out = getTemporaryFile("consumerWithMetadata");
-        StreamUtils.copyStream(is, new FileOutputStream(out), true);
-        return out.toURI().toURL().toExternalForm();
-    }
-
-    /**
-     * Gets a consumer bundle using annotation that does not contain
-     * metadata
-     *
-     * @return the url of the bundle + metadata
-     * @throws IOException
-     */
-    public static String consumerWithoutMetadata() throws IOException {
-        InputStream is = newBundle()
-                .add(Consumer.class)
-                .set(Constants.BUNDLE_SYMBOLICNAME, "Consumer")
-                .set(Constants.IMPORT_PACKAGE, "org.apache.felix.ipojo.online.manipulator.test.service")
-                .build();
-
-        File out = getTemporaryFile("consumerWithoutMetadata");
-        StreamUtils.copyStream(is, new FileOutputStream(out), true);
-        String url = out.toURI().toURL().toExternalForm();
-
-        return url + "!" + OnlineManipulatorTest.class.getClassLoader().getResource("consumer.xml");
-    }
-
-
-    public void dumpServices() throws InvalidSyntaxException {
-        ServiceReference[] refs = context.getAllServiceReferences(null, null);
-        System.out.println(" === Services === ");
-        for (ServiceReference ref : refs) {
-            String[] itf = (String[]) ref.getProperty(Constants.OBJECTCLASS);
-            System.out.println(itf[0]);
-        }
-        System.out.println("====");
-    }
-
-    public void dumpBundles() throws InvalidSyntaxException {
-        Bundle[] bundles = context.getBundles();
-        System.out.println(" === Bundles === ");
-        for (Bundle bundle : bundles) {
-            String sn = bundle.getSymbolicName();
-            System.out.println(sn);
-        }
-        System.out.println("====");
-    }
-
-    private void assertBundle(String sn) {
-        for (Bundle bundle : context.getBundles()) {
-            if (bundle.getSymbolicName().equals(sn)
-                    && bundle.getState() == Bundle.ACTIVE) {
-                return;
-            }
-
-        }
-        Assert.fail("Cannot find the bundle " + sn);
-    }
-
-    private void assertValidity() {
-        try {
-            ServiceReference[] refs = context.getServiceReferences(Architecture.class.getName(), null);
-            Assert.assertNotNull(refs);
-            for (int i = 0; i < refs.length; i++) {
-                InstanceDescription id = ((Architecture) context.getService(refs[i])).getInstanceDescription();
-                int state = id.getState();
-                Assert.assertEquals("State of " + id.getName(), ComponentInstance.VALID, state);
-            }
-        } catch (InvalidSyntaxException e) {
-            Assert.fail(e.getMessage());
-        }
-
-    }
-
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
deleted file mode 100644
index 9c77b1c..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/Consumer.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package org.apache.felix.ipojo.test.online.components;
-
-import org.apache.felix.ipojo.annotations.Component;
-import org.apache.felix.ipojo.annotations.Requires;
-import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
-
-@Component
-public class Consumer {
-    
-    @Requires
-    private Hello hello;
-    
-    public Consumer() {
-        System.out.println(hello.sayHello());
-    }
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
deleted file mode 100644
index 595c199..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/impl/MyProvider.java
+++ /dev/null
@@ -1,11 +0,0 @@
-package org.apache.felix.ipojo.test.online.components;
-
-import org.apache.felix.ipojo.online.manipulator.test.service.Hello;
-
-public class MyProvider implements Hello {
-    
-    public String sayHello() {
-        return "Hello";
-    }
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java b/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
deleted file mode 100644
index c785fbf..0000000
--- a/ipojo/tests/online-manipulator/src/test/java/org/apache/felix/ipojo/online/manipulator/test/service/Hello.java
+++ /dev/null
@@ -1,7 +0,0 @@
-package org.apache.felix.ipojo.online.manipulator.test.service;
-
-public interface Hello {
-    
-    public String sayHello();
-
-}
diff --git a/ipojo/tests/online-manipulator/src/test/resources/consumer.xml b/ipojo/tests/online-manipulator/src/test/resources/consumer.xml
deleted file mode 100644
index b075f7b..0000000
--- a/ipojo/tests/online-manipulator/src/test/resources/consumer.xml
+++ /dev/null
@@ -1,3 +0,0 @@
-<ipojo>
-<instance component="org.apache.felix.ipojo.test.online.components.Consumer"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/online-manipulator/src/test/resources/provider.xml b/ipojo/tests/online-manipulator/src/test/resources/provider.xml
deleted file mode 100644
index 0192784..0000000
--- a/ipojo/tests/online-manipulator/src/test/resources/provider.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<ipojo>
-<component classname="org.apache.felix.ipojo.test.online.components.MyProvider">
-	<provides/>
-</component>
-<instance component="org.apache.felix.ipojo.test.online.components.MyProvider"/>
-</ipojo>
\ No newline at end of file
diff --git a/ipojo/tests/pom.xml b/ipojo/tests/pom.xml
deleted file mode 100644
index 448c1b4..0000000
--- a/ipojo/tests/pom.xml
+++ /dev/null
@@ -1,241 +0,0 @@
-<!--
- Licensed to the Apache Software Foundation (ASF) under one
- or more contributor license agreements.  See the NOTICE file
- distributed with this work for additional information
- regarding copyright ownership.  The ASF licenses this file
- to you under the Apache License, Version 2.0 (the
- "License"); you may not use this file except in compliance
- with the License.  You may obtain a copy of the License at
-
-    http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing,
- software distributed under the License is distributed on an
- "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- KIND, either express or implied.  See the License for the
- specific language governing permissions and limitations
- under the License.
--->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
-    <modelVersion>4.0.0</modelVersion>
-    <groupId>ipojo.tests</groupId>
-    <artifactId>ipojo.tests</artifactId>
-    <version>1.5.0-SNAPSHOT</version>
-    <name>Apache Felix iPOJO Tests</name>
-    <packaging>pom</packaging>
-
-    <repositories>
-        <repository>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <id>ow2.snapshots</id>
-            <name>OW2 Snapshot Repository</name>
-            <url>http://maven.ow2.org/maven2-snapshot/</url>
-        </repository>
-
-        <repository>
-            <id>apache.snapshots</id>
-            <name>snapshot plugins</name>
-            <url>http://repository.apache.org/snapshots</url>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </repository>
-    </repositories>
-
-    <pluginRepositories>
-        <pluginRepository>
-            <id>apache.plugins.snapshots</id>
-            <name>snapshot plugins</name>
-            <url>http://repository.apache.org/snapshots</url>
-            <releases>
-                <enabled>false</enabled>
-            </releases>
-            <snapshots>
-                <enabled>true</enabled>
-            </snapshots>
-        </pluginRepository>
-    </pluginRepositories>
-
-    <properties>
-        <ipojo.core.release>1.8.2</ipojo.core.release>
-        <ipojo.core.snapshot>1.9.0-SNAPSHOT</ipojo.core.snapshot>
-
-        <ipojo.api.release>1.6.0</ipojo.api.release>
-        <ipojo.api.snapshot>1.7.0-SNAPSHOT</ipojo.api.snapshot>
-
-        <ipojo.composite.release>1.8.2</ipojo.composite.release>
-        <ipojo.composite.snapshot>1.9.0-SNAPSHOT</ipojo.composite.snapshot>
-
-        <ipojo.eah.release>1.6.0</ipojo.eah.release>
-        <ipojo.eah.snapshot>1.9.0-SNAPSHOT</ipojo.eah.snapshot>
-        <ipojo.temporal.snapshot>1.7.0-SNAPSHOT</ipojo.temporal.snapshot>
-        <ipojo.wbp.snapshot>1.6.1-SNAPSHOT</ipojo.wbp.snapshot>
-
-        <ipojo.manipulator.release>1.8.6</ipojo.manipulator.release>
-        <ipojo.manipulator.snapshot>1.9.0-SNAPSHOT</ipojo.manipulator.snapshot>
-    </properties>
-
-    <dependencyManagement>
-        <dependencies>
-            <dependency>
-                <groupId>org.osgi</groupId>
-                <artifactId>org.osgi.core</artifactId>
-                <version>4.2.0</version>
-            </dependency>
-            <dependency>
-                <groupId>org.osgi</groupId>
-                <artifactId>org.osgi.compendium</artifactId>
-                <version>4.2.0</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo</artifactId>
-                <version>${ipojo.core.snapshot}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.annotations</artifactId>
-                <version>${ipojo.core.snapshot}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.api</artifactId>
-                <version>${ipojo.api.release}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.composite</artifactId>
-                <version>${ipojo.composite.snapshot}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.manipulator</artifactId>
-                <version>${ipojo.manipulator.release}</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.handler.whiteboard</artifactId>
-                <version>1.4.0</version>
-            </dependency>
-            <dependency>
-                <groupId>org.apache.felix</groupId>
-                <artifactId>org.apache.felix.ipojo.metadata</artifactId>
-                <version>1.4.0</version>
-            </dependency>
-
-            <dependency>
-                <groupId>org.ow2.chameleon.testing</groupId>
-                <artifactId>tinybundles-ipojo</artifactId>
-                <version>0.2.0</version>
-                <scope>test</scope>
-            </dependency>
-            <dependency>
-                <groupId>org.ow2.chameleon.testing</groupId>
-                <artifactId>osgi-helpers</artifactId>
-                <version>0.2.0</version>
-                <scope>test</scope>
-            </dependency>
-        </dependencies>
-    </dependencyManagement>
-
-    <modules>
-        <module>manipulator/manipulation</module>
-        <module>manipulator/metadata</module>
-        <module>manipulator/primitives</module>
-        <module>manipulator/creation</module>
-        <module>core/factories</module>
-        <module>core/lifecycle-controller</module>
-        <module>core/service-providing</module>
-        <module>core/lifecycle-callback</module>
-        <module>core/service-dependency</module>
-        <module>core/service-dependency-bindingpolicy</module>
-        <module>core/service-dependency-filter</module>
-        <module>core/service-dependency-comparator</module>
-        <module>core/service-providing-strategies</module>
-        <module>core/service-providing-inheritance</module>
-        <module>core/service-dependency-optional</module>
-        <module>core/configuration</module>
-        <module>core/handler</module>
-        <module>core/external-handlers</module>
-        <module>core/bad-configurations</module>
-        <module>core/logger</module>
-        <module>core/factory-version</module>
-        <module>composite/composite-runtime</module>
-        <module>composite/import-export</module>
-        <module>composite/service-instance</module>
-        <module>composite/service-providing</module>
-        <module>handler/temporal</module>
-        <module>handler/whiteboard</module>
-        <module>handler/eventadmin</module>
-        <module>core/configadmin</module>
-        <module>api</module>
-        <module>online-manipulator</module>
-    </modules>
-
-    <build>
-        <pluginManagement>
-            <plugins>
-                <plugin>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>maven-ipojo-plugin</artifactId>
-                    <version>${ipojo.manipulator.snapshot}</version>
-                </plugin>
-                <plugin>
-                    <groupId>org.apache.felix</groupId>
-                    <artifactId>maven-bundle-plugin</artifactId>
-                    <version>2.0.1</version>
-                </plugin>
-            </plugins>
-        </pluginManagement>
-        <plugins>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-compiler-plugin</artifactId>
-                <configuration>
-                    <target>1.5</target>
-                    <source>1.5</source>
-                </configuration>
-            </plugin>
-        </plugins>
-    </build>
-    <profiles>
-        <profile>
-            <id>java5</id>
-            <activation>
-                <jdk>1.5</jdk>
-            </activation>
-            <modules>
-                <module>core/annotations</module>
-                <module>manipulator/manipulator-java5</module>
-                <module>handler/jmx</module>
-                <module>handler/transaction</module>
-            </modules>
-        </profile>
-        <profile>
-            <id>java6</id>
-            <activation>
-                <jdk>1.6</jdk>
-            </activation>
-            <modules>
-                <module>core/annotations</module>
-                <module>manipulator/manipulator-java5</module>
-                <module>handler/jmx</module>
-                <module>handler/transaction</module>
-            </modules>
-        </profile>
-
-        <profile>
-            <id>integration-tests</id>
-            <modules>
-                <module>integration-tests</module>
-            </modules>
-        </profile>
-    </profiles>
-
-</project>
