felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r918687 - /felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
Date Wed, 03 Mar 2010 21:01:50 GMT
Author: pderop
Date: Wed Mar  3 21:01:50 2010
New Revision: 918687

URL: http://svn.apache.org/viewvc?rev=918687&view=rev
Log:
Activate dm logging. added integration test for new BundleAdapterService annotation

Modified:
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java?rev=918687&r1=918686&r2=918687&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/BundleDependencyAnnotationTest.java
Wed Mar  3 21:01:50 2010
@@ -21,9 +21,9 @@
 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.Dictionary;
-import java.util.Hashtable;
+import java.util.Properties;
 
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.test.BundleGenerator;
@@ -46,6 +46,7 @@
     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(),
@@ -60,14 +61,31 @@
                     .build()));           
     }
 
+    /**
+     * Tests a simple Consumer, which has a BundleDependency over the dependency manager
bundle.
+     * @param context
+     */
     @Test
     public void testBundleDependencyAnnotation(BundleContext context)
     {
         DependencyManager m = new DependencyManager(context);
-        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(),
null));
+        Properties props = new Properties() {{ put("test", "consumer"); }};
+        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(),
props));
         m_ensure.waitForStep(1, 10000);
         super.stopBundle("BundleDependencyTest", context);
         m_ensure.waitForStep(2, 10000);
     }
     
+    /**
+     * Tests a Bundle Adapter, which adapts the dependency manager bundle to a "ServiceInterface"
service.
+     * @param context
+     */
+    @Test
+    public void testBundleAdapterServiceAnnotation(BundleContext context)
+    {
+        DependencyManager m = new DependencyManager(context);
+        Properties props = new Properties() {{ put("test", "adapter"); }};
+        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(),
props));
+        m_ensure.waitForStep(3, 10000);
+    }    
 }



Mime
View raw message