diff --git a/dependencymanager/test/pom.xml b/dependencymanager/test/pom.xml
index c7994b1..a2c2443 100644
--- a/dependencymanager/test/pom.xml
+++ b/dependencymanager/test/pom.xml
@@ -88,7 +88,6 @@
       <groupId>junit</groupId>
       <artifactId>junit</artifactId>
       <version>4.7</version>
-      <scope>test</scope>
     </dependency>
   </dependencies>
   <build>
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
new file mode 100644
index 0000000..9adf699
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceConsumer.java
@@ -0,0 +1,69 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+import junit.framework.Assert;
+
+import org.apache.felix.dm.annotation.api.Destroy;
+import org.apache.felix.dm.annotation.api.ResourceDependency;
+import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.resources.Resource;
+import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
+
+@Service
+public class ResourceConsumer
+{
+    @ServiceDependency(filter = "(test=resource)")
+    Sequencer m_sequencer;
+    
+    private int m_resourcesSeen;
+
+    @ResourceDependency(required = false, filter = "(&(path=/test)(name=*.txt)(repository=TestRepository))")
+    public void add(Resource resource)
+    {
+        if (match(resource, "test1.txt", "/test", "TestRepository"))
+        {
+            m_resourcesSeen++;
+            return;
+        }
+
+        if (match(resource, "test2.txt", "/test", "TestRepository"))
+        {
+            m_resourcesSeen++;
+            return;
+        }
+
+        Assert.fail("Got unexpected resource: " + resource.getName() + "/" + resource.getPath()
+            + "/" + resource.getRepository());
+    }
+
+    private boolean match(Resource resource, String name, String path, String repo)
+    {
+        return name.equals(resource.getName()) && path.equals(resource.getPath())
+            && repo.equals(resource.getRepository());
+    }
+
+    @Destroy
+    private void destroy()
+    {
+        Assert.assertEquals(2, m_resourcesSeen);
+        m_sequencer.step(1);
+    }
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
new file mode 100644
index 0000000..1d702aa
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ResourceProvider.java
@@ -0,0 +1,127 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import junit.framework.Assert;
+
+import org.apache.felix.dm.annotation.api.Destroy;
+import org.apache.felix.dm.annotation.api.Service;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.resources.Resource;
+import org.apache.felix.dm.resources.ResourceHandler;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Filter;
+import org.osgi.framework.InvalidSyntaxException;
+import org.osgi.framework.ServiceReference;
+
+@Service
+public class ResourceProvider
+{
+    private volatile BundleContext m_context;
+    private final Map m_handlers = new HashMap();
+    private StaticResource[] m_resources = {
+            new StaticResource("test1.txt", "/test", "TestRepository")
+            {
+                public InputStream openStream() throws IOException
+                {
+                    return null;
+                };
+            }, new StaticResource("test2.txt", "/test", "TestRepository")
+            {
+                public InputStream openStream() throws IOException
+                {
+                    return null;
+                };
+            }, new StaticResource("README.doc", "/", "TestRepository")
+            {
+                public InputStream openStream() throws IOException
+                {
+                    Assert.fail("resource should not have matched the filter");
+                    return null;
+                };
+            } };
+
+    @ServiceDependency(removed = "remove", required=false)
+    public void add(ServiceReference ref, ResourceHandler handler)
+    {
+        String filterString = (String) ref.getProperty("filter");
+        Filter filter;
+        try
+        {
+            filter = m_context.createFilter(filterString);
+        }
+        catch (InvalidSyntaxException e)
+        {
+            Assert.fail("Could not create filter for resource handler: " + e);
+            return;
+        }
+        synchronized (m_handlers)
+        {
+            m_handlers.put(handler, filter);
+        }
+        for (int i = 0; i < m_resources.length; i++)
+        {
+            if (filter.match(m_resources[i].getProperties()))
+            {
+                handler.added(m_resources[i]);
+            }
+        }
+    }
+
+    public void remove(ServiceReference ref, ResourceHandler handler)
+    {
+        Filter filter;
+        synchronized (m_handlers)
+        {
+            filter = (Filter) m_handlers.remove(handler);
+        }
+        removeResources(handler, filter);
+    }
+
+    private void removeResources(ResourceHandler handler, Filter filter)
+    {
+        for (int i = 0; i < m_resources.length; i++)
+        {
+            if (filter.match(m_resources[i].getProperties()))
+            {
+                handler.removed(m_resources[i]);
+            }
+        }
+    }
+
+    @Destroy
+    public void destroy()
+    {
+        Entry[] handlers;
+        synchronized (m_handlers)
+        {
+            handlers = (Entry[]) m_handlers.entrySet().toArray(new Entry[m_handlers.size()]);
+        }
+        for (int i = 0; i < handlers.length; i++)
+        {
+            removeResources((ResourceHandler) handlers[i].getKey(), (Filter) handlers[i].getValue());
+        }
+    }
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
new file mode 100644
index 0000000..611d9fe
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceConsumer.java
@@ -0,0 +1,40 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+import org.apache.felix.dm.annotation.api.Service;
+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;
+
+@Service
+public class ServiceConsumer
+{
+    @ServiceDependency
+    ServiceInterface m_serviceInterface;
+    
+    @ServiceDependency(filter = "(test=adapter)")
+    Sequencer m_sequencer;
+    
+    @Start
+    void start() {
+        m_sequencer.step(1);
+        m_serviceInterface.run();
+    }
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
new file mode 100644
index 0000000..1d238da
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceInterface.java
@@ -0,0 +1,24 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+public interface ServiceInterface extends Runnable
+{
+    
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java
new file mode 100644
index 0000000..465a429
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/ServiceProvider.java
@@ -0,0 +1,49 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+import junit.framework.Assert;
+
+import org.apache.felix.dm.annotation.api.Param;
+import org.apache.felix.dm.annotation.api.ResourceAdapterService;
+import org.apache.felix.dm.annotation.api.ServiceDependency;
+import org.apache.felix.dm.resources.Resource;
+import org.apache.felix.dm.test.bundle.annotation.sequencer.Sequencer;
+
+@ResourceAdapterService(
+    filter = "(&(path=/test)(name=test1.txt)(repository=TestRepository))", 
+    properties = {@Param(name="foo", value="bar")},
+    propagate = true)
+public class ServiceProvider implements ServiceInterface
+{
+    // Injected by reflection
+    Resource m_resource;
+        
+    @ServiceDependency(filter="(test=adapter)")
+    Sequencer m_sequencer;
+    
+    public void run()
+    {
+        Assert.assertNotNull("Resource has not been injected in the adapter", m_resource);
+        Assert.assertEquals("ServiceProvider did not get expected resource", "test1.txt", m_resource.getName());
+        Assert.assertEquals("ServiceProvider did not get expected resource", "/test", m_resource.getPath());
+        Assert.assertEquals("ServiceProvider did not get expected resource", "TestRepository", m_resource.getRepository());
+        m_sequencer.step(2);
+    }
+}
diff --git a/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/StaticResource.java b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/StaticResource.java
new file mode 100644
index 0000000..5fd9627
--- /dev/null
+++ b/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/resource/StaticResource.java
@@ -0,0 +1,70 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.resource;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Dictionary;
+import java.util.Properties;
+
+import org.apache.felix.dm.resources.Resource;
+
+public class StaticResource implements Resource
+{
+    private String m_id;
+    private String m_name;
+    private String m_path;
+    private String m_repository;
+
+    public StaticResource(String name, String path, String repository) {
+        m_id = repository + ":" + path + "/" + name;
+        m_name = name;
+        m_path = path;
+        m_repository = repository;
+    }
+    
+    public String getID() {
+        return m_id;
+    }
+
+    public String getName() {
+        return m_name;
+    }
+
+    public String getPath() {
+        return m_path;
+    }
+
+    public String getRepository() {
+        return m_repository;
+    }
+    
+    public Dictionary getProperties() {
+        return new Properties() {{
+            put(Resource.ID, getID());
+            put(Resource.NAME, getName());
+            put(Resource.PATH, getPath());
+            put(Resource.REPOSITORY, getRepository());
+        }};
+    }
+
+    public InputStream openStream() throws IOException {
+        return null;
+    }
+}
diff --git a/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ResourceAnnotationTest.java b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ResourceAnnotationTest.java
new file mode 100644
index 0000000..e7fb948
--- /dev/null
+++ b/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ResourceAnnotationTest.java
@@ -0,0 +1,93 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one
+* or more contributor license agreements.  See the NOTICE file
+* distributed with this work for additional information
+* regarding copyright ownership.  The ASF licenses this file
+* to you under the Apache License, Version 2.0 (the
+* "License"); you may not use this file except in compliance
+* with the License.  You may obtain a copy of the License at
+*
+*   http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing,
+* software distributed under the License is distributed on an
+* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF 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.Properties;
+
+import org.apache.felix.dm.DependencyManager;
+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 Bundle Dependency annotations usage.
+ */
+@RunWith(JUnit4TestRunner.class)
+public class ResourceAnnotationTest extends AnnotationBase
+{
+    @Configuration
+    public static Option[] configuration()
+    {
+        return options(
+            systemProperty("dm.log").value( "true" ),
+            provision(
+                mavenBundle().groupId("org.osgi").artifactId("org.osgi.compendium").version("4.1.0"),
+                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, "ResourceTest")
+                    .set("Export-Package", "org.apache.felix.dm.test.bundle.annotation.sequencer")
+                    .set("Private-Package", "org.apache.felix.dm.test.bundle.annotation.resource")
+                    .set("Import-Package", "*")
+                    .set("-plugin", "org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin")
+                    .build()));           
+    }
+
+    /**
+     * Tests a simple ResourceConsumer
+     * @param context
+     */
+    @Test
+    public void testResourceAnnotation(BundleContext context)
+    {
+        DependencyManager m = new DependencyManager(context);
+        Properties props = new Properties() {{ put("test", "resource"); }};
+        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(), props));
+        super.stopBundle("ResourceTest", context);
+        m_ensure.waitForStep(1, 10000);
+    }
+    
+    /**
+     * Tests a ResourceAdapter
+     * @param context
+     */
+    @Test
+    public void testResourceAdapterAnnotation(BundleContext context)
+    {
+        // TODO currently, this test fails because it sounds like there is a bug in ResourceAdapterImpl, which 
+        // does not propagate the resource adapter filter ...        
+        DependencyManager m = new DependencyManager(context);
+        Properties props = new Properties() {{ put("test", "adapter"); }};
+        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(), props));
+        super.stopBundle("ResourceTest", context);
+        m_ensure.waitForStep(2, 10000);
+    }
+}
\ No newline at end of file
