felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1021370 - /felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
Date Mon, 11 Oct 2010 15:04:51 GMT
Author: pderop
Date: Mon Oct 11 15:04:51 2010
New Revision: 1021370

URL: http://svn.apache.org/viewvc?rev=1021370&view=rev
Log:
Since this tests defines two extra dependencies from an init method, then we have to use service.add(List)
signature ...

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

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java?rev=1021370&r1=1021369&r2=1021370&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2369_ExtraDependencyTest.java
Mon Oct 11 15:04:51 2010
@@ -21,10 +21,15 @@ package org.apache.felix.dm.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 java.util.Arrays;
+import java.util.List;
+
 import junit.framework.Assert;
 
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.Component;
+import org.apache.felix.dm.ServiceDependency;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.ops4j.pax.exam.Option;
@@ -93,16 +98,19 @@ public class FELIX2369_ExtraDependencyTe
         public void init(Component s) {
             DependencyManager dm = s.getDependencyManager();
             m_ensure.step(m_startStep);
-            s.add(dm.createServiceDependency() // this dependency is available at this point
-                .setInstanceBound(true)
-                .setService(MyService1.class)
-                .setRequired(false)
-                .setCallbacks("bind", null));
-            s.add(dm.createServiceDependency() // not available: we should not be started
-                  .setInstanceBound(true)
-                  .setService(MyService2.class)
-                  .setRequired(true)
-                  .setAutoConfig("m_myService2"));
+            List extra = Arrays.asList(new ServiceDependency[] {
+                    dm.createServiceDependency() // this dependency is available at this
point
+                      .setInstanceBound(true)
+                      .setService(MyService1.class)
+                      .setRequired(false)
+                      .setCallbacks("bind", null),
+                    dm.createServiceDependency() // not available: we should not be started
+                      .setInstanceBound(true)
+                      .setService(MyService2.class)
+                      .setRequired(true)
+                      .setAutoConfig("m_myService2")
+            });
+            s.add(extra);
         }
 
         public void start() {



Mime
View raw message