You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by dj...@apache.org on 2013/07/16 01:15:41 UTC

svn commit: r1503517 - in /felix/trunk/scr/src/test: java/org/apache/felix/scr/integration/ComponentActivationTest.java resources/integration_test_activation_components.xml

Author: djencks
Date: Mon Jul 15 23:15:40 2013
New Revision: 1503517

URL: http://svn.apache.org/r1503517
Log:
FELIX-4166 unregister service if it becomes unsatisfied before being created, tests for unactivated components

Modified:
    felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
    felix/trunk/scr/src/test/resources/integration_test_activation_components.xml

Modified: felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java?rev=1503517&r1=1503516&r2=1503517&view=diff
==============================================================================
--- felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java (original)
+++ felix/trunk/scr/src/test/java/org/apache/felix/scr/integration/ComponentActivationTest.java Mon Jul 15 23:15:40 2013
@@ -285,9 +285,17 @@ public class ComponentActivationTest ext
     }
 
     @Test
-    public void test_activate_register_service_multiple_static_dependency()
+    public void test_activate_register_service_multiple_static_reluctant_dependency()
     {
-        final String componentname = "ActivatorComponent.bind.multiple.static";
+        final String componentname = "ActivatorComponent.bind.multiple.static.reluctant";
+
+        testRequiredDependency( componentname );
+    }
+
+    @Test
+    public void test_activate_register_service_multiple_static_greedy_dependency()
+    {
+        final String componentname = "ActivatorComponent.bind.multiple.static.greedy";
 
         testRequiredDependency( componentname );
     }

Modified: felix/trunk/scr/src/test/resources/integration_test_activation_components.xml
URL: http://svn.apache.org/viewvc/felix/trunk/scr/src/test/resources/integration_test_activation_components.xml?rev=1503517&r1=1503516&r2=1503517&view=diff
==============================================================================
--- felix/trunk/scr/src/test/resources/integration_test_activation_components.xml (original)
+++ felix/trunk/scr/src/test/resources/integration_test_activation_components.xml Mon Jul 15 23:15:40 2013
@@ -17,7 +17,7 @@
     specific language governing permissions and limitations
     under the License.
 -->
-<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.1.0">
+<components xmlns:scr="http://www.osgi.org/xmlns/scr/v1.2.0">
 
     <!-- 
         Components used for the ComponentActivationTest integration test.
@@ -149,7 +149,7 @@
     </scr:component>
 
     <!-- 1n static dependency -->
-    <scr:component name="ActivatorComponent.bind.multiple.static"
+    <scr:component name="ActivatorComponent.bind.multiple.static.reluctant"
         enabled="false"
         activate="myActivate"
         deactivate="myDeactivate">
@@ -168,6 +168,27 @@
         />
     </scr:component>
 
+    <!-- 1n static greedy dependency -->
+    <scr:component name="ActivatorComponent.bind.multiple.static.greedy"
+        enabled="false"
+        activate="myActivate"
+        deactivate="myDeactivate">
+        <implementation class="org.apache.felix.scr.integration.components.ActivatorComponent" />
+        <service factory="false">
+            <provide interface="org.apache.felix.scr.integration.components.ActivatorComponent"/>
+        </service>
+        <property name="registerService" value="true" />
+        <reference
+            name="service"
+            interface="org.apache.felix.scr.integration.components.SimpleService"
+            bind="bindSimpleService"
+            unbind="unbindSimpleService"
+            policy="static"
+            policy-option="greedy"
+            cardinality="1..n"
+        />
+    </scr:component>
+
     <!-- 11 dynamic dependency -->
     <scr:component name="ActivatorComponent.bind.single.dynamic"
         enabled="false"
@@ -188,7 +209,7 @@
         />
     </scr:component>
 
-    <!-- 11 static dependency -->
+    <!-- 1n dynamic dependency -->
     <scr:component name="ActivatorComponent.bind.multiple.dynamic"
         enabled="false"
         activate="myActivate"