felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r918523 - in /felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test: AspectTest.java BundleDependencyTest.java FELIX2078_ServiceDependencyTest.java annotation/MultipleAnnotationTest.java
Date Wed, 03 Mar 2010 15:40:02 GMT
Author: marrs
Date: Wed Mar  3 15:40:02 2010
New Revision: 918523

URL: http://svn.apache.org/viewvc?rev=918523&view=rev
Log:
Updated tests to new annotation API.

Modified:
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AspectTest.java
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleDependencyTest.java
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2078_ServiceDependencyTest.java
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/MultipleAnnotationTest.java

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AspectTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AspectTest.java?rev=918523&r1=918522&r2=918523&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AspectTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/AspectTest.java
Wed Mar  3 15:40:02 2010
@@ -22,8 +22,6 @@
 import static org.ops4j.pax.exam.CoreOptions.options;
 import static org.ops4j.pax.exam.CoreOptions.provision;
 
-import java.util.Properties;
-
 import org.apache.felix.dm.DependencyManager;
 import org.apache.felix.dm.service.Service;
 import org.junit.Test;
@@ -32,7 +30,6 @@
 import org.ops4j.pax.exam.junit.Configuration;
 import org.ops4j.pax.exam.junit.JUnit4TestRunner;
 import org.osgi.framework.BundleContext;
-import org.osgi.framework.Constants;
 
 @RunWith(JUnit4TestRunner.class)
 public class AspectTest extends Base {
@@ -55,7 +52,7 @@
         Service sp = m.createService().setImplementation(new ServiceProvider(e)).setInterface(ServiceInterface.class.getName(),
null);
         Service sp2 = m.createService().setImplementation(new ServiceProvider2(e)).setInterface(ServiceInterface2.class.getName(),
null);
         Service sc = m.createService().setImplementation(new ServiceConsumer(e)).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true));
-        Service sa = m.createAspectService(ServiceInterface.class, "(|(!(" + Constants.SERVICE_RANKING
+ "=*))(" + Constants.SERVICE_RANKING + "<=0))", new ServiceAspect(e), new Properties()
{{ put(Constants.SERVICE_RANKING, Integer.valueOf(1)); }} );
+        Service sa = m.createAspectService(ServiceInterface.class, null, 1, new ServiceAspect(e),
null);
         m.add(sc);
         m.add(sp);
         e.waitForStep(3, 15000);

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleDependencyTest.java?rev=918523&r1=918522&r2=918523&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleDependencyTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/BundleDependencyTest.java
Wed Mar  3 15:40:02 2010
@@ -79,7 +79,13 @@
         
         // helper class that ensures certain steps get executed in sequence
         Ensure e = new Ensure();
-        Service consumerWithFilter = m.createService().setImplementation(new FilteredConsumerRequired(e)).add(m.createBundleDependency().setRequired(true).setFilter("(Bundle-SymbolicName=org.apache.felix.dependencymanager)").setCallbacks("add",
"remove"));
+        Service consumerWithFilter = m.createService()
+            .setImplementation(new FilteredConsumerRequired(e))
+            .add(m.createBundleDependency()
+                .setRequired(true)
+                .setFilter("(Bundle-SymbolicName=org.apache.felix.dependencymanager)")
+                .setCallbacks("add", "remove")
+                );
         // add a consumer with a filter
         m.add(consumerWithFilter);
         e.waitForStep(1, 10000);
@@ -133,7 +139,8 @@
         }
         
         public void add(Bundle b) {
-            Assert.assertNotNull(b);
+            System.out.println("Bundle is " + b);
+//            Assert.assertNotNull(b);
             if (b.getSymbolicName().equals("org.apache.felix.dependencymanager")) {
                 m_ensure.step(1);
             }

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2078_ServiceDependencyTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2078_ServiceDependencyTest.java?rev=918523&r1=918522&r2=918523&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2078_ServiceDependencyTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/FELIX2078_ServiceDependencyTest.java
Wed Mar  3 15:40:02 2010
@@ -54,6 +54,7 @@
         Service sc = m.createService().setImplementation(new ServiceConsumer(e)).add(m.createServiceDependency().setService(ServiceInterface.class).setRequired(true).setCallbacks("add",
"remove"));
         m.add(sp);
         m.add(sp2);
+        System.out.println("test");
         m.add(sc);
         // wait until both services have been added to our consumer
         e.waitForStep(2, 5000);

Modified: felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/MultipleAnnotationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/MultipleAnnotationTest.java?rev=918523&r1=918522&r2=918523&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/MultipleAnnotationTest.java
(original)
+++ felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/MultipleAnnotationTest.java
Wed Mar  3 15:40:02 2010
@@ -62,7 +62,9 @@
     {
         DependencyManager m = new DependencyManager(context);
         // Provide the Sequencer service to the MultipleAnnotationTest class.
-        m.add(m.createService().setImplementation(this).setInterface(Sequencer.class.getName(),
null));
+        m.add(m.createService()
+            .setImplementation(this)
+            .setInterface(Sequencer.class.getName(), null));
         // Check if the test.annotation components have been initialized orderly
         m_ensure.waitForStep(7, 10000);
         // Stop the test.annotation bundle



Mime
View raw message