felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1531751 - in /felix/trunk/dependencymanager: test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ test/src/test/java/org/apache/felix/dm/test/annotation/ test2/src/main/java/org/apache/felix/dependencymanager/test...
Date Sun, 13 Oct 2013 21:05:36 GMT
Author: pderop
Date: Sun Oct 13 21:05:35 2013
New Revision: 1531751

URL: http://svn.apache.org/r1531751
Log:
pax-exam 3.0.0 migration ...

Added:
    felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java
      - copied, changed from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
    felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java
      - copied, changed from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
    felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java
      - copied, changed from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
    felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
      - copied, changed from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
    felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java
      - copied, changed from r1531247, felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java
Removed:
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java

Copied: felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java
(from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java?p2=felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java&p1=felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java&r1=1531247&r2=1531751&rev=1531751&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAdapterServiceProperties.java
(original)
+++ felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAdapterServiceProperties.java
Sun Oct 13 21:05:35 2013
@@ -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;
@@ -26,72 +26,62 @@ import org.apache.felix.dm.annotation.ap
 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
-    {
+public class ExtraAdapterServiceProperties {
+    public interface Provider {
     }
 
+    public interface Provider2 {
+    }
 
-    @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 {
     }
-    
-    @AdapterService(provides=Provider2.class, properties={@Property(name="foo2", value="bar2")},
adapteeService=Provider.class)
-    public static class Provider2Impl implements Provider2
-    {
+
+    @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"); }};
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo3", "bar3");
+                }
+            };
         }
     }
-    
+
     @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraAdapterServiceProperties)")
-        Sequencer m_sequencer;
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraAdapterServiceProperties)")
+        volatile Ensure m_sequencer;
 
-        private Map m_properties;
+        private volatile Map m_properties;
 
         @ServiceDependency
-        void bind(Map properties, Provider2 provider2)
-        {
+        void bind(Map properties, Provider2 provider2) {
             m_properties = properties;
         }
-        
+
         @Start
-        void start() 
-        {
+        void start() {
             System.out.println("provider2 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);
-            }         
-            
-            if ("bar3".equals(m_properties.get("foo3"))) 
-            {
+            }
+
+            if ("bar3".equals(m_properties.get("foo3"))) {
                 m_sequencer.step(3);
-            }            
+            }
         }
     }
 }

Copied: felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java
(from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java?p2=felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java&p1=felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java&r1=1531247&r2=1531751&rev=1531751&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraAspectServiceProperties.java
(original)
+++ felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraAspectServiceProperties.java
Sun Oct 13 21:05:35 2013
@@ -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;
@@ -26,65 +26,57 @@ import org.apache.felix.dm.annotation.ap
 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
-    {
+public class ExtraAspectServiceProperties {
+    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 {
     }
-    
-    @AspectService(ranking=10, properties={@Property(name="foo2", value="bar2")})
-    public static class ProviderAspectImpl 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"); }};
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo3", "aspect");
+                }
+            };
         }
     }
-    
+
     @Component
-    public static class Consumer
-    {
-        @ServiceDependency(filter="(test=ExtraAspectServiceProperties)")
-        Sequencer m_sequencer;
+    public static class Consumer {
+        @ServiceDependency(filter = "(name=testExtraAspectServiceProperties)")
+        volatile Ensure m_sequencer;
 
-        private Map m_properties;
+        private volatile Map m_properties;
 
         @ServiceDependency
-        void bind(Map properties, Provider provider)
-        {
+        void bind(Map properties, Provider provider) {
             m_properties = properties;
         }
-        
+
         @Start
-        void start() 
-        {
+        void start() {
             System.out.println("provider aspect 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);
-            }         
-            
-            if ("aspect".equals(m_properties.get("foo3"))) 
-            {
+            }
+
+            if ("aspect".equals(m_properties.get("foo3"))) {
                 m_sequencer.step(3);
-            }            
+            }
         }
     }
 }

Copied: felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java
(from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java?p2=felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java&p1=felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java&r1=1531247&r2=1531751&rev=1531751&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraFactoryServiceProperties.java
(original)
+++ felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraFactoryServiceProperties.java
Sun Oct 13 21:05:35 2013
@@ -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.Dictionary;
 import java.util.HashMap;
@@ -28,67 +28,62 @@ import org.apache.felix.dm.annotation.ap
 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
-    {
+public class ExtraFactoryServiceProperties {
+    public interface Provider {
     }
 
-    @Component(properties={@Property(name="foo", value="bar")}, factorySet="MyFactory")
-    public static class ProviderImpl implements 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"); }};
+        Map<String, String> start() {
+            return new HashMap<String, String>() {
+                {
+                    put("foo2", "bar2");
+                }
+            };
         }
     }
-    
+
     @Component
-    public static class ProviderImplFactory
-    {
+    public static class ProviderImplFactory {
         @ServiceDependency
-        Set<Dictionary> m_factory;
-        
+        volatile Set<Dictionary> m_factory;
+
         @Start
-        void start()
-        {
-            m_factory.add(new Hashtable() {{ put("foo3", "bar3"); }});
+        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;
-        
+    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)
-        {
+        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);
             }
-            
-            if ("bar3".equals(m_properties.get("foo3"))) 
-            {
+
+            if ("bar3".equals(m_properties.get("foo3"))) {
                 m_sequencer.step(3);
             }
         }

Copied: felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
(from r1531247, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java?p2=felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java&p1=felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java&r1=1531247&r2=1531751&rev=1531751&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/extraproperties/ExtraServiceProperties.java
(original)
+++ felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/ExtraServiceProperties.java
Sun Oct 13 21:05:35 2013
@@ -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.ap
 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);
-            }            
+            }
         }
     }
 }

Copied: felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java
(from r1531247, felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java?p2=felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java&p1=felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java&r1=1531247&r2=1531751&rev=1531751&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/ExtraServicePropertiesTest.java
(original)
+++ felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/ExtraServicePropertiesTest.java
Sun Oct 13 21:05:35 2013
@@ -16,101 +16,61 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.dm.test.annotation;
+package org.apache.felix.dependencymanager.test2.integration.annotations;
 
-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.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.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;
+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(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()));            
-    }
-
+@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(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);
+    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(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);
+    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(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);
+    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(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);
+    public void testExtraAspectServiceProperties() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "testExtraAspectServiceProperties");
+        e.waitForStep(3, 10000);
+        sr.unregister();
     }
 }



Mime
View raw message