felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pde...@apache.org
Subject svn commit: r1531939 - in /felix/trunk/dependencymanager: test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ test/src/test/java/org/apache/felix/dm/test/annotation/ test2/src/main/java/org/apache/felix/dependencymanager/test2/comp...
Date Mon, 14 Oct 2013 15:09:29 GMT
Author: pderop
Date: Mon Oct 14 15:09:29 2013
New Revision: 1531939

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

Added:
    felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/PropagateAnnotation.java
      - copied, changed from r1531934, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
    felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/PropagateAnnotationTest.java
      - copied, changed from r1531934, felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/PropagateAnnotationTest.java
Removed:
    felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
    felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/PropagateAnnotationTest.java

Copied: felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/PropagateAnnotation.java
(from r1531934, felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/PropagateAnnotation.java?p2=felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/PropagateAnnotation.java&p1=felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java&r1=1531934&r2=1531939&rev=1531939&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/main/java/org/apache/felix/dm/test/bundle/annotation/propagate/ServiceDependencyPropagateTest.java
(original)
+++ felix/trunk/dependencymanager/test2/src/main/java/org/apache/felix/dependencymanager/test2/components/PropagateAnnotation.java
Mon Oct 14 15:09:29 2013
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.felix.dm.test.bundle.annotation.propagate;
+package org.apache.felix.dependencymanager.test2.components;
 
 import java.util.Map;
 
@@ -24,25 +24,23 @@ 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;
 
 /**
  * Verifies ServiceDependencyservice properties propagation.
  */
-public class ServiceDependencyPropagateTest
-{
+public class PropagateAnnotation {
     @Component
     public static class Consumer {
-        private Map m_producerProps;
+        private volatile Map m_producerProps;
 
         @ServiceDependency
         void bind(Map props, Producer producer) {
             m_producerProps = props;
         }
-        
-        @ServiceDependency(filter="(name=ServiceDependencyPropagateTest)")
-        Sequencer m_sequencer;
-        
+
+        @ServiceDependency(filter = "(name=test.PropagateAnnotationTest)")
+        volatile Ensure m_sequencer;
+
         @Start
         void start() {
             m_sequencer.step(1);
@@ -54,15 +52,14 @@ public class ServiceDependencyPropagateT
             }
         }
     }
-    
-    @Component(provides={Producer.class}, properties={@Property(name="foo", value="bar")})
+
+    @Component(provides = {Producer.class}, properties = {@Property(name = "foo", value =
"bar")})
     public static class Producer {
-        @ServiceDependency(propagate=true)
-        Producer2 m_producer;
+        @ServiceDependency(propagate = true)
+        volatile Producer2 m_producer;
     }
-    
 
-    @Component(provides={Producer2.class}, properties={@Property(name="foo2", value="bar2")})
+    @Component(provides = {Producer2.class}, properties = {@Property(name = "foo2", value
= "bar2")})
     public static class Producer2 {
     }
 }

Copied: felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/PropagateAnnotationTest.java
(from r1531934, felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/PropagateAnnotationTest.java)
URL: http://svn.apache.org/viewvc/felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/PropagateAnnotationTest.java?p2=felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/PropagateAnnotationTest.java&p1=felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/PropagateAnnotationTest.java&r1=1531934&r2=1531939&rev=1531939&view=diff
==============================================================================
--- felix/trunk/dependencymanager/test/src/test/java/org/apache/felix/dm/test/annotation/PropagateAnnotationTest.java
(original)
+++ felix/trunk/dependencymanager/test2/src/test/java/org/apache/felix/dependencymanager/test2/integration/annotations/PropagateAnnotationTest.java
Mon Oct 14 15:09:29 2013
@@ -16,58 +16,25 @@
  * 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 org.apache.felix.dm.DependencyManager;
-import org.apache.felix.dm.test.Base;
-import org.apache.felix.dm.test.BundleGenerator;
+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 that dependency "propagate" option is properly propagating properties
to provided service.
  */
-@RunWith(JUnit4TestRunner.class)
-public class PropagateAnnotationTest 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.configadmin").version("1.2.4"),
-                mavenBundle().groupId("org.apache.felix").artifactId("org.apache.felix.dependencymanager.runtime").versionAsInProject()),
-            provision(
-                new BundleGenerator()
-                    .set(Constants.BUNDLE_SYMBOLICNAME, "PropagateAnnotationTest")
-                    .set("Export-Package", "org.apache.felix.dm.test.bundle.annotation.sequencer")
-                    .set("Private-Package", "org.apache.felix.dm.test.bundle.annotation.propagate")
-                    .set("Import-Package", "*")
-                    .set("-plugin", "org.apache.felix.dm.annotation.plugin.bnd.AnnotationPlugin")
-                    .build()));            
-    }
-
-    /**
-     * A Service that just registers/unregisters its service, using the @ServiceLifecycle
annotation.
-     */
+@RunWith(PaxExam.class)
+public class PropagateAnnotationTest extends TestBase {
     @Test
-    public void testServiceDependencyPropagate(BundleContext context)
-    {
-        DependencyManager m = new DependencyManager(context);
-        m.add(makeSequencer(m, "ServiceDependencyPropagateTest")); 
-        m_ensure.waitForStep(3, 10000);
-    }    
+    public void testServiceDependencyPropagate() {
+        Ensure e = new Ensure();
+        ServiceRegistration sr = register(e, "test.PropagateAnnotationTest");
+        e.waitForStep(3, 10000);
+        sr.unregister();
+    }
 }



Mime
View raw message