diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
deleted file mode 100644
index 5a096eb..0000000
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.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.dm.test.bundle.annotation.extraproperties;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.felix.dm.annotation.api.AdapterService;
-import org.apache.felix.dm.annotation.api.Component;
-import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.ServiceDependency;
-import org.apache.felix.dm.annotation.api.Start;
-import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-
-/**
- * This test validates that an adapter Service may specify some extra service properties
- * from it's start callback
- */
-public class ExtraAdapterServiceProperties
-{
-    public interface Provider
-    {
-    }
-    
-    public interface Provider2
-    {
-    }
-
-
-    @Component(properties={@Property(name="foo", value="bar")})
-    public static class ProviderImpl implements Provider
-    {
-    }
-    
-    @AdapterService(provides=Provider2.class, properties={@Property(name="foo2", value="bar2")}, adapteeService=Provider.class)
-    public static class Provider2Impl implements Provider2
-    {
-        protected Provider m_adaptee;
-        
-        @Start
-        Map<String, String> start()
-        {
-            return new HashMap<String, String>() {{ put("foo3", "bar3"); }};
-        }
-    }
-    
-    @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraAdapterServiceProperties)")
-        Sequencer m_sequencer;
-
-        private Map m_properties;
-
-        @ServiceDependency
-        void bind(Map properties, Provider2 provider2)
-        {
-            m_properties = properties;
-        }
-        
-        @Start
-        void start() 
-        {
-            System.out.println("provider2 service properties: " + m_properties);
-            if ("bar".equals(m_properties.get("foo"))) 
-            {
-                m_sequencer.step(1);
-            }
-            
-            if ("bar2".equals(m_properties.get("foo2"))) 
-            {
-                m_sequencer.step(2);
-            }         
-            
-            if ("bar3".equals(m_properties.get("foo3"))) 
-            {
-                m_sequencer.step(3);
-            }            
-        }
-    }
-}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
deleted file mode 100644
index 50b885c..0000000
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.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.dm.test.bundle.annotation.extraproperties;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.felix.dm.annotation.api.AspectService;
-import org.apache.felix.dm.annotation.api.Component;
-import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.ServiceDependency;
-import org.apache.felix.dm.annotation.api.Start;
-import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-
-/**
- * This test validates that an adapter Service may specify some extra service properties
- * from it's start callback
- */
-public class ExtraAspectServiceProperties
-{
-    public interface Provider
-    {
-    }
-    
-    @Component(properties={@Property(name="foo", value="bar")})
-    public static class ProviderImpl implements Provider
-    {
-    }
-    
-    @AspectService(ranking=10, properties={@Property(name="foo2", value="bar2")})
-    public static class ProviderAspectImpl implements Provider
-    {        
-        @Start
-        Map<String, String> start()
-        {
-            return new HashMap<String, String>() {{ put("foo3", "aspect"); }};
-        }
-    }
-    
-    @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraAspectServiceProperties)")
-        Sequencer m_sequencer;
-
-        private Map m_properties;
-
-        @ServiceDependency
-        void bind(Map properties, Provider provider)
-        {
-            m_properties = properties;
-        }
-        
-        @Start
-        void start() 
-        {
-            System.out.println("provider aspect service properties: " + m_properties);
-            if ("bar".equals(m_properties.get("foo"))) 
-            {
-                m_sequencer.step(1);
-            }
-            
-            if ("bar2".equals(m_properties.get("foo2"))) 
-            {
-                m_sequencer.step(2);
-            }         
-            
-            if ("aspect".equals(m_properties.get("foo3"))) 
-            {
-                m_sequencer.step(3);
-            }            
-        }
-    }
-}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
deleted file mode 100644
index 8ae5587..0000000
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- *   http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.felix.dm.test.bundle.annotation.extraproperties;
-
-import java.util.Dictionary;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Map;
-import java.util.Set;
-
-import org.apache.felix.dm.annotation.api.Component;
-import org.apache.felix.dm.annotation.api.Property;
-import org.apache.felix.dm.annotation.api.ServiceDependency;
-import org.apache.felix.dm.annotation.api.Start;
-import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-
-public class ExtraFactoryServiceProperties
-{
-    public interface Provider
-    {
-    }
-
-    @Component(properties={@Property(name="foo", value="bar")}, factorySet="MyFactory")
-    public static class ProviderImpl implements Provider
-    {
-        @Start
-        Map<String, String> start()
-        {
-            return new HashMap<String, String>() {{ put("foo2", "bar2"); }};
-        }
-    }
-    
-    @Component
-    public static class ProviderImplFactory
-    {
-        @ServiceDependency
-        Set<Dictionary> m_factory;
-        
-        @Start
-        void start()
-        {
-            m_factory.add(new Hashtable() {{ put("foo3", "bar3"); }});
-        }
-    }
-    
-    @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraFactoryServiceProperties)")
-        Sequencer m_sequencer;
-        
-        private Map m_properties;
-        
-        @ServiceDependency
-        void bindProvider(Map properties, Provider m_provider)
-        {
-            m_properties = properties;
-        }
-        
-        @Start
-        void start() 
-        {
-            System.out.println("provider service properties: " + m_properties);
-            if ("bar".equals(m_properties.get("foo"))) 
-            {
-                m_sequencer.step(1);
-            }
-            
-            if ("bar2".equals(m_properties.get("foo2"))) 
-            {
-                m_sequencer.step(2);
-            }
-            
-            if ("bar3".equals(m_properties.get("foo3"))) 
-            {
-                m_sequencer.step(3);
-            }
-        }
-    }
-}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java
deleted file mode 100644
index 979a22b..0000000
--- a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.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.dm.test.annotation;
-
-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 java.util.Hashtable;
-
-import org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.test.Base;
-import org.apache.felix.dm.test.BundleGenerator;
-import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-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;
-
-/**
- * Use case: Verify the a Service may provide its service properties dynamically from its start method.
- */
-@RunWith(JUnit4TestRunner.class)
-public class ExtraServicePropertiesTest extends AnnotationBase
-{
-    @Configuration
-    public static Option[] configuration()
-    {
-        return options(
-            systemProperty(DMLOG_PROPERTY).value( "true" ),
-            provision(
-                mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version(Base.OSGI_SPEC_VERSION),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager").versionAsInProject(),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager.runtime").versionAsInProject()),
-            provision(
-                new BundleGenerator()
-                    .set(Constants.BUNDLE_SYMBOLICNAME, "ExtraPropertiesTest")
-                    .set("Export-Package", "org.apache.felix.dm.test.bundle.annotation.sequencer")
-                    .set("Private-Package", "org.apache.felix.dm.test.bundle.annotation.extraproperties")
-                    .set("Import-Package", "*")
-                    .set("-plugin", "org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin")
-                    .build()));            
-    }
-
-    /**
-     * Tests if a Service can provide its service properties from its start method.
-     */
-    @Test
-    public void testExtraServiceProperties(BundleContext context)
-    {
-        DependencyManager m = new DependencyManager(context);
-        // Provide the Sequencer service to the "Component" service.
-        m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), 
-                                                                     new Hashtable() {{ put("test", "ExtraServiceProperties"); }}));
-        m_ensure.waitForStep(2, 10000);
-    }
-    
-    /**
-     * Tests if a Service instantiated by a Factory can provide its service properties from its start method.
-     */
-    @Test
-    public void testExtraFactoryServiceProperties(BundleContext context)
-    {
-        DependencyManager m = new DependencyManager(context);
-        // Provide the Sequencer service to the "Component" service.
-        m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), 
-                                                                     new Hashtable() {{ put("test", "ExtraFactoryServiceProperties"); }}));
-        m_ensure.waitForStep(3, 10000);
-    }
-
-    /**
-     * Tests if an AdapterService can provide its service properties from its start method.
-     */
-    @Test
-    public void testExtraAdapterServiceProperties(BundleContext context)
-    {
-        DependencyManager m = new DependencyManager(context);
-        // Provide the Sequencer service to the "Component" service.
-        m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), 
-                                                                     new Hashtable() {{ put("test", "ExtraAdapterServiceProperties"); }}));
-        m_ensure.waitForStep(3, 10000);
-    }
-    
-    /**
-     * Tests if an AspectService can provide its service properties from its start method.
-     */
-    @Test
-    public void testExtraAspectServiceProperties(BundleContext context)
-    {
-        DependencyManager m = new DependencyManager(context);
-        // Provide the Sequencer service to the "Component" service.
-        m.add(m.createComponent().setImplementation(this).setInterface(Sequencer.class.getName(), 
-                                                                     new Hashtable() {{ put("test", "ExtraAspectServiceProperties"); }}));
-        m_ensure.waitForStep(3, 10000);
-    }
-}
diff --git a/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java
new file mode 100644
index 0000000..ccba089
--- /dev/null
+++ b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dependencymanager.test2.components;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.felix.dm.annotation.api.AdapterService;
+import org.apache.felix.dm.annotation.api.Component;
+import org.apache.felix.dm.annotation.api.Property;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.annotation.api.Start;
+
+/**
+ * This test validates that an adapter Service may specify some extra service properties
+ * from it's start callback
+ */
+public class ExtraAdapterServiceProperties {
+    public interface Provider {
+    }
+
+    public interface Provider2 {
+    }
+
+    @Component(properties = {@Property(name = "foo", value = "bar")})
+    public static class ProviderImpl implements Provider {
+    }
+
+    @AdapterService(provides = Provider2.class, properties = {@Property(name = "foo2", value = "bar2")}, adapteeService = Provider.class)
+    public static class Provider2Impl implements Provider2 {
+        protected Provider m_adaptee;
+
+        @Start
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo3", "bar3");
+                }
+            };
+        }
+    }
+
+    @Component
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraAdapterServiceProperties)")
+        volatile Ensure m_sequencer;
+
+        private volatile Map m_properties;
+
+        @ServiceDependency
+        void bind(Map properties, Provider2 provider2) {
+            m_properties = properties;
+        }
+
+        @Start
+        void start() {
+            System.out.println("provider2 service properties: " + m_properties);
+            if ("bar".equals(m_properties.get("foo"))) {
+                m_sequencer.step(1);
+            }
+
+            if ("bar2".equals(m_properties.get("foo2"))) {
+                m_sequencer.step(2);
+            }
+
+            if ("bar3".equals(m_properties.get("foo3"))) {
+                m_sequencer.step(3);
+            }
+        }
+    }
+}
diff --git a/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java
new file mode 100644
index 0000000..7b2c7c6
--- /dev/null
+++ b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dependencymanager.test2.components;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.felix.dm.annotation.api.AspectService;
+import org.apache.felix.dm.annotation.api.Component;
+import org.apache.felix.dm.annotation.api.Property;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.annotation.api.Start;
+
+/**
+ * This test validates that an adapter Service may specify some extra service properties
+ * from it's start callback
+ */
+public class ExtraAspectServiceProperties {
+    public interface Provider {
+    }
+
+    @Component(properties = {@Property(name = "foo", value = "bar")})
+    public static class ProviderImpl implements Provider {
+    }
+
+    @AspectService(ranking = 10, properties = {@Property(name = "foo2", value = "bar2")})
+    public static class ProviderAspectImpl implements Provider {
+        @Start
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo3", "aspect");
+                }
+            };
+        }
+    }
+
+    @Component
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraAspectServiceProperties)")
+        volatile Ensure m_sequencer;
+
+        private volatile Map m_properties;
+
+        @ServiceDependency
+        void bind(Map properties, Provider provider) {
+            m_properties = properties;
+        }
+
+        @Start
+        void start() {
+            System.out.println("provider aspect service properties: " + m_properties);
+            if ("bar".equals(m_properties.get("foo"))) {
+                m_sequencer.step(1);
+            }
+
+            if ("bar2".equals(m_properties.get("foo2"))) {
+                m_sequencer.step(2);
+            }
+
+            if ("aspect".equals(m_properties.get("foo3"))) {
+                m_sequencer.step(3);
+            }
+        }
+    }
+}
diff --git a/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java
new file mode 100644
index 0000000..a39b5f3
--- /dev/null
+++ b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java
@@ -0,0 +1,91 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dependencymanager.test2.components;
+
+import java.util.Dictionary;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Map;
+import java.util.Set;
+
+import org.apache.felix.dm.annotation.api.Component;
+import org.apache.felix.dm.annotation.api.Property;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.annotation.api.Start;
+
+public class ExtraFactoryServiceProperties {
+    public interface Provider {
+    }
+
+    @Component(properties = {@Property(name = "foo", value = "bar")}, factorySet = "MyFactory")
+    public static class ProviderImpl implements Provider {
+        @Start
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo2", "bar2");
+                }
+            };
+        }
+    }
+
+    @Component
+    public static class ProviderImplFactory {
+        @ServiceDependency
+        volatile Set<Dictionary> m_factory;
+
+        @Start
+        void start() {
+            m_factory.add(new Hashtable() {
+                {
+                    put("foo3", "bar3");
+                }
+            });
+        }
+    }
+
+    @Component
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraFactoryServiceProperties)")
+        volatile Ensure m_sequencer;
+
+        private volatile Map m_properties;
+
+        @ServiceDependency
+        void bindProvider(Map properties, Provider m_provider) {
+            m_properties = properties;
+        }
+
+        @Start
+        void start() {
+            System.out.println("provider service properties: " + m_properties);
+            if ("bar".equals(m_properties.get("foo"))) {
+                m_sequencer.step(1);
+            }
+
+            if ("bar2".equals(m_properties.get("foo2"))) {
+                m_sequencer.step(2);
+            }
+
+            if ("bar3".equals(m_properties.get("foo3"))) {
+                m_sequencer.step(3);
+            }
+        }
+    }
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
similarity index 61%
rename from dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
rename to dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
index 388e3e6..530aa7a 100644
--- a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
+++ b/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.dm.test.bundle.annotation.extraproperties;
+package org.apache.felix.dependencymanager.test2.components;
 
 import java.util.HashMap;
 import java.util.Map;
@@ -25,55 +25,49 @@
 import org.apache.felix.dm.annotation.api.Property;
 import org.apache.felix.dm.annotation.api.ServiceDependency;
 import org.apache.felix.dm.annotation.api.Start;
-import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
 
 /**
  * This test validates that a basic Service may specify some extra service properties
  * from it's start callback
  */
-public class ExtraServiceProperties
-{
-    public interface Provider
-    {
+public class ExtraServiceProperties {
+    public interface Provider {
     }
 
-    @Component(properties={@Property(name="foo", value="bar")})
-    public static class ProviderImpl implements Provider
-    {
+    @Component(properties = {@Property(name = "foo", value = "bar")})
+    public static class ProviderImpl implements Provider {
         @Start
-        Map<String, String> start()
-        {
-            return new HashMap<String, String>() {{ put("foo2", "bar2"); }};
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo2", "bar2");
+                }
+            };
         }
     }
-    
+
     @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraServiceProperties)")
-        Sequencer m_sequencer;
-        
-        private Map m_properties;
-        
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraServiceProperties)")
+        volatile Ensure m_sequencer;
+
+        private volatile Map m_properties;
+
         @ServiceDependency
-        void bindProvider(Map properties, Provider m_provider)
-        {
+        void bindProvider(Map properties, Provider m_provider) {
             m_properties = properties;
         }
-        
+
         @Start
-        void start() 
-        {
+        void start() {
             System.out.println("provider service properties: " + m_properties);
-            if ("bar".equals(m_properties.get("foo"))) 
-            {
+            if ("bar".equals(m_properties.get("foo"))) {
                 m_sequencer.step(1);
             }
-            
-            if ("bar2".equals(m_properties.get("foo2"))) 
-            {
+
+            if ("bar2".equals(m_properties.get("foo2"))) {
                 m_sequencer.step(2);
-            }            
+            }
         }
     }
 }
diff --git a/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java
new file mode 100644
index 0000000..b5f1060
--- /dev/null
+++ b/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.dependencymanager.test2.integration.annotations;
+
+import org.apache.felix.dependencymanager.test2.components.Ensure;
+import org.apache.felix.dependencymanager.test2.integration.common.TestBase;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.osgi.framework.ServiceRegistration;
+
+/**
+ * Use case: Verify the a Service may provide its service properties dynamically from its start method.
+ */
+@RunWith(PaxExam.class)
+public class ExtraServicePropertiesTest extends TestBase {
+    /**
+     * Tests if a Service can provide its service properties from its start method.
+     */
+    @Test
+    public void testExtraServiceProperties() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "testExtraServiceProperties");
+        e.waitForStep(2, 10000);
+        sr.unregister();
+    }
+
+    /**
+     * Tests if a Service instantiated by a Factory can provide its service properties from its start method.
+     */
+    @Test
+    public void testExtraFactoryServiceProperties() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "testExtraFactoryServiceProperties");
+        e.waitForStep(3, 10000);
+        sr.unregister();
+    }
+
+    /**
+     * Tests if an AdapterService can provide its service properties from its start method.
+     */
+    @Test
+    public void testExtraAdapterServiceProperties() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "testExtraAdapterServiceProperties");
+        e.waitForStep(3, 10000);
+        sr.unregister();
+    }
+
+    /**
+     * Tests if an AspectService can provide its service properties from its start method.
+     */
+    @Test
+    public void testExtraAspectServiceProperties() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "testExtraAspectServiceProperties");
+        e.waitForStep(3, 10000);
+        sr.unregister();
+    }
+}
