felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From clem...@apache.org
Subject svn commit: r1448522 [3/20] - in /felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test: ./ src/ src/main/ src/main/java/ src/main/java/org/ src/main/java/org/apache/ src/main/java/org/apache/felix/ src/main/java/org/apache/felix/...
Date Thu, 21 Feb 2013 06:35:20 GMT
Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-policies.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-policies.xml?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-policies.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata-policies.xml Thu Feb 21 06:35:17 2013
@@ -0,0 +1,264 @@
+<ipojo 
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+    xmlns="org.apache.felix.ipojo"
+>
+
+	<!-- Static Dependencies -->
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticSimpleCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static" />
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticVoidCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="voidBind" />
+			<callback type="unbind" method="voidUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticObjectCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticRefCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticBothCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMObjectCheckServiceProvider" architecture="true">
+		<requires policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMRefCheckServiceProvider" architecture="true">
+		<requires
+			specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+			policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMBothCheckServiceProvider" architecture="true">
+		<requires policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+
+	<!-- Static Simple & Optional Dependencies -->
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticSimpleOptionalCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" optional="true" policy="static" />
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticVoidOptionalCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" optional="true" policy="static">
+			<callback type="bind" method="voidBind" />
+			<callback type="unbind" method="voidUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticObjectOptionalCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" optional="true" policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticRefOptionalCheckServiceProvider" architecture="true">
+		<requires field="fs" optional="true" policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.CheckServiceProvider"
+		name="StaticBothOptionalCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" optional="true" policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMObjectOptionalCheckServiceProvider"
+		architecture="true">
+		<requires optional="true" policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMRefOptionalCheckServiceProvider"
+		architecture="true">
+		<requires
+			specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+			optional="true" policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodCheckServiceProvider"
+		name="StaticMBothOptionalCheckServiceProvider"
+		architecture="true">
+		<requires
+			specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+			optional="true" policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<!--  Static Multiple Dependencies -->
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MultipleCheckService"
+		name="StaticSimpleMultipleCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" policy="static" />
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MultipleCheckService"
+		name="StaticVoidMultipleCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="voidBind" />
+			<callback type="unbind" method="voidUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MultipleCheckService"
+		name="StaticObjectMultipleCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MultipleCheckService"
+		name="StaticRefMultipleCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MultipleCheckService"
+		name="StaticBothMultipleCheckServiceProvider"
+		architecture="true">
+		<requires field="fs" policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodMultipleCheckService"
+		name="StaticMObjectMultipleCheckServiceProvider"
+		architecture="true">
+		<requires aggregate="true" policy="static">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodMultipleCheckService"
+		name="StaticMRefMultipleCheckServiceProvider"
+		architecture="true">
+		<requires
+			specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+			aggregate="true" policy="static">
+			<callback type="bind" method="refBind" />
+			<callback type="unbind" method="refUnbind" />
+		</requires>
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.MethodMultipleCheckService"
+		name="StaticMBothMultipleCheckServiceProvider"
+		architecture="true">
+		<requires aggregate="true" policy="static">
+			<callback type="bind" method="bothBind" />
+			<callback type="unbind" method="bothUnbind" />
+		</requires>
+		<provides />
+	</component>	
+	
+	<!-- Dynamic-Priority -->
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.RankedFooProviderType1"
+		name="RankedFooProviderType" architecture="true">
+		<provides>
+			<property field="m_grade" name="service.ranking"/>
+		</provides>
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.DynCheckServiceProvider"
+		name="DPSimpleCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="dynamic-priority" />
+		<provides />
+	</component>
+	<component
+		classname="org.apache.felix.ipojo.runtime.core.test.components.policies.DynCheckServiceProvider"
+		name="DPObjectCheckServiceProvider" architecture="true">
+		<requires field="fs" policy="dynamic-priority">
+			<callback type="bind" method="objectBind" />
+			<callback type="unbind" method="objectUnbind" />
+		</requires>
+		<provides />
+	</component>
+</ipojo>

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata.xml
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata.xml?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata.xml (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/main/resources/metadata.xml Thu Feb 21 06:35:17 2013
@@ -0,0 +1,1064 @@
+<ipojo>
+<!--
+xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="org.apache.felix.ipojo http://felix.apache.org/ipojo/schemas/SNAPSHOT/core.xsd"
+  xmlns="org.apache.felix.ipojo"
+ -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.FooProviderType1"
+    name="FooProviderType-1" architecture="true">
+    <provides />
+  </component>
+
+  <!--  Simple Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="SimpleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="VoidCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ObjectCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="RefCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="BothCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+    <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="MapCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DictCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedSimpleCheckServiceProvider" architecture="true">
+    <requires field="fs" />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedVoidCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedObjectCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedRefCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedBothCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+    <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedMapCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedDictCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DoubleCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <requires field="fs" proxy="true"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedDoubleCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <requires field="fs" />
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MObjectCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MRefCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MBothCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MMapCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MDictCheckServiceProvider" architecture="true">
+    <requires>
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!-- Simple & Optional Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="SimpleOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" id="FooService" proxy="false"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="SimpleOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false" />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="VoidOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="VoidOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ObjectOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ObjectOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="RefOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="RefOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="BothOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="MapOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DictOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedSimpleOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" id="FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedVoidOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedObjectOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedRefOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedBothOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedMapOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ProxiedDictOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="BothOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="MapOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DictOptionalNoNullableCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true" nullable="false">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MObjectOptionalCheckServiceProvider" architecture="true">
+    <requires optional="true">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MRefOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MBothOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MMapOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="MDictOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+
+  <!-- Simple & Optional Dependencies with default-implementation -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DISimpleOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl" />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIVoidOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIObjectOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIRefOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIBothOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIMapOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DIDictOptionalCheckServiceProvider" architecture="true">
+    <requires field="fs" optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="DIMObjectOptionalCheckServiceProvider" architecture="true">
+    <requires optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="DIMRefOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="DIMBothOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="DIMMapOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodCheckServiceProvider"
+    name="DIMDictOptionalCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      optional="true"
+      default-implementation="org.apache.felix.ipojo.runtime.core.test.components.FooServiceDefaultImpl">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Multiple Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="SimpleMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedSimpleMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" />
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="VoidMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedVoidMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ObjectMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedObjectMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="RefMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedRefMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="BothMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedBothMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="MapMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedMapMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="DictMultipleCheckServiceProvider" architecture="true" >
+    <requires field="fs" proxy="false">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedDictMultipleCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MObjectMultipleCheckServiceProvider" architecture="true">
+    <requires aggregate="true">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MRefMultipleCheckServiceProvider" architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      aggregate="true">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MBothMultipleCheckServiceProvider" architecture="true">
+    <requires aggregate="true">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MMapMultipleCheckServiceProvider" architecture="true">
+    <requires aggregate="true">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MDictMultipleCheckServiceProvider" architecture="true">
+    <requires aggregate="true">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!-- Multiple & Optional Dependencies -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="SimpleOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true" proxy="false"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="VoidOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ObjectOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="RefOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true" proxy="false">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedSimpleOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true" />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedVoidOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedObjectOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MultipleCheckService"
+    name="ProxiedRefOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires field="fs" optional="true">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MObjectOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires aggregate="true" optional="true">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.MethodMultipleCheckService"
+    name="MRefOptionalMultipleCheckServiceProvider"
+    architecture="true">
+    <requires
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"
+      aggregate="true" optional="true">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+    </requires>
+    <provides />
+  </component>
+
+  <!-- Aggregate dependency as List -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.ListCheckService"
+    name="SimpleListCheckServiceProvider" architecture="true">
+    <requires proxy="false"
+      field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.ListCheckService"
+    name="OptionalListCheckServiceProvider"
+    architecture="true">
+    <requires proxy="false"
+      specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true" />
+    <provides />
+  </component>
+   <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.ListCheckService"
+    name="ProxiedSimpleListCheckServiceProvider" architecture="true">
+    <requires field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.ListCheckService"
+    name="ProxiedOptionalListCheckServiceProvider"
+    architecture="true">
+    <requires specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true" />
+    <provides />
+  </component>
+
+  <!-- Aggregate dependency as Vector -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.VectorCheckService"
+    name="SimpleVectorCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="objectBind"/>
+      <callback type="unbind" method="objectUnbind"/>
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.VectorCheckService"
+    name="OptionalVectorCheckServiceProvider"
+    architecture="true">
+    <requires specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true" />
+    <provides />
+  </component>
+
+  <!-- Aggregate dependency as Set -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.SetCheckService"
+    name="SimpleSetCheckServiceProvider" architecture="true">
+    <requires proxy="false" field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.SetCheckService"
+    name="OptionalSetCheckServiceProvider"
+    architecture="true">
+    <requires proxy="false" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true" />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.SetCheckService"
+    name="ProxiedSimpleSetCheckServiceProvider" architecture="true">
+    <requires field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.SetCheckService"
+    name="ProxiedOptionalSetCheckServiceProvider"
+    architecture="true">
+    <requires specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true" />
+    <provides />
+  </component>
+
+  <!-- Aggregate dependency as Collection -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CollectionCheckService"
+    name="SimpleCollectionCheckServiceProvider" architecture="true">
+    <requires field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" proxy="false"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CollectionCheckService"
+    name="ProxiedSimpleCollectionCheckServiceProvider" architecture="true">
+    <requires field="fs" specification="org.apache.felix.ipojo.runtime.core.test.services.FooService"/>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CollectionCheckService"
+    name="OptionalCollectionCheckServiceProvider"
+    architecture="true">
+    <requires specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true"
+      proxy="false"
+    />
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CollectionCheckService"
+    name="ProxiedOptionalCollectionCheckServiceProvider"
+    architecture="true">
+    <requires specification="org.apache.felix.ipojo.runtime.core.test.services.FooService" field="fs" optional="true"
+      proxy="false"
+    />
+    <provides />
+  </component>
+
+
+  <!-- Modify method test -->
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.FooProviderType2"
+    name="FooProviderType-Updatable" architecture="true">
+    <provides>
+      <property name="foo" field="m_foo" value="foo"/>
+    </provides>
+  </component>
+
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="VoidModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="voidBind" />
+      <callback type="unbind" method="voidUnbind" />
+      <callback type="modified" method="voidModify"/>
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="ObjectModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="objectBind" />
+      <callback type="unbind" method="objectUnbind" />
+      <callback type="modified" method="objectModify" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="RefModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="refBind" />
+      <callback type="unbind" method="refUnbind" />
+      <callback type="modified" method="refModify" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="BothModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="bothBind" />
+      <callback type="unbind" method="bothUnbind" />
+      <callback type="modified" method="bothModify" />
+    </requires>
+    <provides />
+  </component>
+    <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="MapModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesMapBind" />
+      <callback type="unbind" method="propertiesMapUnbind" />
+      <callback type="modified" method="propertiesMapModify" />
+    </requires>
+    <provides />
+  </component>
+  <component
+    classname="org.apache.felix.ipojo.runtime.core.test.components.CheckServiceProvider"
+    name="DictModifyCheckServiceProvider" architecture="true">
+    <requires field="fs">
+      <callback type="bind" method="propertiesDictionaryBind" />
+      <callback type="unbind" method="propertiesDictionaryUnbind" />
+      <callback type="modified" method="propertiesDictionaryModify" />
+    </requires>
+    <provides />
+  </component>
+
+  <!--  Proxy Tests -->
+  <component classname="org.apache.felix.ipojo.runtime.core.test.components.proxy.CheckServiceDelegator">
+    <provides/>
+    <requires field="fs" optional="true"/>
+  </component>
+  <component classname="org.apache.felix.ipojo.runtime.core.test.components.proxy.CheckServiceGetAndDelegate">
+    <provides/>
+    <requires field="fs" optional="true"/>
+  </component>
+  <component classname="org.apache.felix.ipojo.runtime.core.test.components.proxy.CheckServiceNoDelegate">
+      <provides/>
+      <requires field="fs" optional="true"/>
+      <callback transition="validate" method="start"/>
+    <callback transition="invalidate" method="stop"/>
+  </component>
+
+  <component
+  	classname="org.apache.felix.ipojo.runtime.core.test.components.proxy.CheckServiceUsingStringService"
+  	immediate="true">
+    <provides/>
+    <requires field="string"/>
+    <requires field="map"/>
+  </component>
+
+	<!-- Inner + Proxy mix -->
+  <component
+  	classname="org.apache.felix.ipojo.runtime.core.test.components.inner.C1">
+  		<provides/>
+  </component>
+  <component
+  	classname="org.apache.felix.ipojo.runtime.core.test.components.inner.C2">
+  		<provides specifications="org.apache.felix.ipojo.runtime.core.test.components.inner.C2"/>
+		<requires field="c1"/>
+  </component>
+  <component
+  	classname="org.apache.felix.ipojo.runtime.core.test.components.inner.C3">
+  		<provides specifications="org.apache.felix.ipojo.runtime.core.test.components.inner.C3"/>
+		<requires field="c2"/>
+  </component>
+
+</ipojo>

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/Common.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,254 @@
+package org.apache.felix.ipojo.runtime.core.test.dependencies;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.io.filefilter.TrueFileFilter;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.runner.RunWith;
+import org.ops4j.pax.exam.Configuration;
+import org.ops4j.pax.exam.Option;
+import org.ops4j.pax.exam.junit.PaxExam;
+import org.ops4j.pax.exam.options.CompositeOption;
+import org.ops4j.pax.exam.options.DefaultCompositeOption;
+import org.ops4j.pax.exam.spi.reactors.ExamReactorStrategy;
+import org.ops4j.pax.exam.spi.reactors.PerClass;
+import org.ops4j.pax.tinybundles.core.TinyBundle;
+import org.ops4j.pax.tinybundles.core.TinyBundles;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleContext;
+import org.osgi.framework.Constants;
+import org.osgi.framework.ServiceReference;
+import org.ow2.chameleon.testing.helpers.IPOJOHelper;
+import org.ow2.chameleon.testing.helpers.OSGiHelper;
+import org.ow2.chameleon.testing.tinybundles.ipojo.IPOJOStrategy;
+import org.slf4j.LoggerFactory;
+
+import javax.inject.Inject;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import static org.ops4j.pax.exam.CoreOptions.*;
+
+/**
+ * Bootstrap the test from this project
+ */
+@RunWith(PaxExam.class)
+@ExamReactorStrategy(PerClass.class)
+public class Common {
+
+    @Inject
+    BundleContext bc;
+
+    protected OSGiHelper osgiHelper;
+    protected IPOJOHelper ipojoHelper;
+
+    Bundle testedBundle;
+
+    @Configuration
+    public Option[] config() throws MalformedURLException {
+        Logger root = (Logger) LoggerFactory.getLogger(Logger.ROOT_LOGGER_NAME);
+        root.setLevel(Level.INFO);
+
+        return options(
+                ipojoBundles(),
+                junitBundles(),
+                testedBundle(),
+                eventadmin(),
+                systemProperty("org.ops4j.pax.logging.DefaultServiceLog.level").value("WARN")
+        );
+    }
+
+    @Before
+    public void commonSetUp() {
+        osgiHelper = new OSGiHelper(bc);
+        ipojoHelper = new IPOJOHelper(bc);
+
+        testedBundle = osgiHelper.getBundle("test.bundle");
+
+        // Dump OSGi Framework information
+        String vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VENDOR);
+        if (vendor == null) {
+            vendor = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_SYMBOLICNAME);
+        }
+        String version = (String) osgiHelper.getBundle(0).getHeaders().get(Constants.BUNDLE_VERSION);
+        System.out.println("OSGi Framework : " + vendor + " - " + version);
+
+        // Wait for stability.
+        waitForStability(bc);
+    }
+
+    /**
+     * Waits for stability:
+     * <ul>
+     * <li>all bundles are activated
+     * <li>service count is stable
+     * </ul>
+     * If the stability can't be reached after a specified time,
+     * the method throws a {@link IllegalStateException}.
+     *
+     * @param context the bundle context
+     * @throws IllegalStateException when the stability can't be reach after a several attempts.
+     */
+    private void waitForStability(BundleContext context) throws IllegalStateException {
+        // Wait for bundle initialization.
+        boolean bundleStability = getBundleStability(context);
+        int count = 0;
+        while (!bundleStability && count < 500) {
+            try {
+                Thread.sleep(5);
+            } catch (InterruptedException e) {
+                // Interrupted
+            }
+            count++;
+            bundleStability = getBundleStability(context);
+        }
+
+        if (count == 500) {
+            System.out.println("Bundle stability isn't reached after 500 tries");
+            dumpBundles(context);
+            throw new IllegalStateException("Cannot reach the bundle stability");
+        }
+
+        boolean serviceStability = false;
+        count = 0;
+        int count1 = 0;
+        int count2 = 0;
+        while (!serviceStability && count < 500) {
+            try {
+                ServiceReference[] refs = context.getServiceReferences((String) null, null);
+                count1 = refs.length;
+                Thread.sleep(500);
+                refs = context.getServiceReferences((String) null, null);
+                count2 = refs.length;
+                serviceStability = count1 == count2;
+            } catch (Exception e) {
+                System.err.println(e);
+                serviceStability = false;
+                // Nothing to do, while recheck the condition
+            }
+            count++;
+        }
+
+        if (count == 500) {
+            System.err.println("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
+            dumpBundles(context);
+            throw new IllegalStateException("Cannot reach the service stability");
+        }
+
+    }
+
+    /**
+     * Are bundle stables.
+     *
+     * @param bc the bundle context
+     * @return <code>true</code> if every bundles are activated.
+     */
+    private boolean getBundleStability(BundleContext bc) {
+        boolean stability = true;
+        Bundle[] bundles = bc.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            stability = stability && (bundles[i].getState() == Bundle.ACTIVE);
+        }
+        return stability;
+    }
+
+    /**
+     * Prints the bundle list.
+     *
+     * @param bc the bundle context.
+     */
+    public void dumpBundles(BundleContext bc) {
+        System.out.println("Bundles:");
+        Bundle[] bundles = bc.getBundles();
+        for (int i = 0; i < bundles.length; i++) {
+            System.out.println(bundles[i].getSymbolicName() + " - " + bundles[i].getState());
+        }
+    }
+
+
+    @After
+    public void commonTearDown() {
+        osgiHelper.dispose();
+        ipojoHelper.dispose();
+    }
+
+    public CompositeOption ipojoBundles() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo").versionAsInProject(),
+                mavenBundle("org.ow2.chameleon.testing", "osgi-helpers").versionAsInProject());
+    }
+
+    public CompositeOption eventadmin() {
+        return new DefaultCompositeOption(
+                mavenBundle("org.apache.felix", "org.apache.felix.eventadmin", "1.3.0"),
+                mavenBundle("org.apache.felix", "org.apache.felix.ipojo.handler.eventadmin",
+                        "1.8.0").versionAsInProject());
+    }
+
+    public Option testedBundle() throws MalformedURLException {
+        File out = new File("target/bundles/bundle.jar");
+        if (out.exists()) {
+            return bundle(out.toURI().toURL().toExternalForm());
+        }
+
+        TinyBundle tested = TinyBundles.bundle();
+
+        // We look inside target/classes to find the class and resources
+        File classes = new File("target/classes");
+        Collection<File> files = FileUtils.listFilesAndDirs(classes, TrueFileFilter.INSTANCE, TrueFileFilter.INSTANCE);
+        List<File> services = new ArrayList<File>();
+        for (File file : files) {
+            if (file.isDirectory()) {
+                // By convention we export of .services and .service package
+                if (file.getName().endsWith("services") || file.getName().endsWith("service")) {
+                    services.add(file);
+                }
+            } else {
+                // We need to compute the path
+                String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+                tested.add(path, file.toURI().toURL());
+                System.out.println(file.getName() + " added to " + path);
+            }
+        }
+
+        // We export 'inner'
+        String export = "org.apache.felix.ipojo.runtime.core.test.components.inner";
+        for (File file : services) {
+            if (export.length() > 0) {
+                export += ", ";
+            }
+            String path = file.getAbsolutePath().substring(classes.getAbsolutePath().length() + 1);
+            String packageName = path.replace('/', '.');
+            export += packageName;
+        }
+
+        System.out.println("Exported packages : " + export);
+
+        InputStream inputStream = tested
+                .set(Constants.BUNDLE_SYMBOLICNAME, "test.bundle")
+                .set(Constants.IMPORT_PACKAGE, "*")
+                .set(Constants.EXPORT_PACKAGE, export)
+                .build(IPOJOStrategy.withiPOJO(new File("src/main/resources")));
+
+        try {
+            org.apache.commons.io.FileUtils.copyInputStreamToFile(inputStream, out);
+            return bundle(out.toURI().toURL().toExternalForm());
+        } catch (MalformedURLException e) {
+            throw new RuntimeException("Cannot compute the url of the manipulated bundle");
+        } catch (IOException e) {
+            throw new RuntimeException("Cannot write of the manipulated bundle");
+        }
+    }
+
+    public BundleContext getContext() {
+        return bc;
+    }
+
+}

Added: felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/TestCollectionMultipleDependencies.java
URL: http://svn.apache.org/viewvc/felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/TestCollectionMultipleDependencies.java?rev=1448522&view=auto
==============================================================================
--- felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/TestCollectionMultipleDependencies.java (added)
+++ felix/trunk/ipojo/runtime/core-it/src/it/ipojo-core-service-dependency-test/src/test/java/org/apache/felix/ipojo/runtime/core/test/dependencies/TestCollectionMultipleDependencies.java Thu Feb 21 06:35:17 2013
@@ -0,0 +1,245 @@
+/* 
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.felix.ipojo.runtime.core.test.dependencies;
+
+import org.apache.felix.ipojo.ComponentInstance;
+import org.apache.felix.ipojo.architecture.Architecture;
+import org.apache.felix.ipojo.architecture.InstanceDescription;
+import org.apache.felix.ipojo.runtime.core.test.services.CheckService;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.ServiceReference;
+
+import java.util.Properties;
+
+import static org.junit.Assert.*;
+
+public class TestCollectionMultipleDependencies extends Common {
+
+    ComponentInstance instance1, instance2;
+    ComponentInstance fooProvider1, fooProvider2;
+
+    @Before
+    public void setUp() {
+        try {
+            Properties prov = new Properties();
+            prov.put("instance.name", "FooProvider1");
+            fooProvider1 = ipojoHelper.getFactory("FooProviderType-1").createComponentInstance(prov);
+            fooProvider1.stop();
+
+            Properties prov2 = new Properties();
+            prov2.put("instance.name", "FooProvider2");
+            fooProvider2 = ipojoHelper.getFactory("FooProviderType-1").createComponentInstance(prov2);
+            fooProvider2.stop();
+
+            Properties i1 = new Properties();
+            i1.put("instance.name", "Simple");
+            instance1 = ipojoHelper.getFactory("SimpleCollectionCheckServiceProvider").createComponentInstance(i1);
+
+            Properties i2 = new Properties();
+            i2.put("instance.name", "Optional");
+            instance2 = ipojoHelper.getFactory("OptionalCollectionCheckServiceProvider").createComponentInstance(i2);
+        } catch (Exception e) {
+            fail(e.getMessage());
+        }
+
+    }
+
+    @After
+    public void tearDown() {
+        instance1.dispose();
+        instance2.dispose();
+        fooProvider1.dispose();
+        fooProvider2.dispose();
+        instance1 = null;
+        instance2 = null;
+        fooProvider1 = null;
+        fooProvider2 = null;
+    }
+
+    @Test public void testSimple() {
+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), instance1.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance invalidity - 1", id.getState() == ComponentInstance.INVALID);
+
+        fooProvider1.start();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+
+        ServiceReference cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance1.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0, 0);
+
+        fooProvider2.start();
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 2.0, 0);
+
+        fooProvider1.stop();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 3", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 3", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 3", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 3", ((Integer) props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long) props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double) props.get("double")).doubleValue(), 1.0, 0);
+
+        fooProvider2.stop();
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.INVALID);
+    }
+
+    @Test public void testOptional() {
+        ServiceReference arch_ref = ipojoHelper.getServiceReferenceByName(Architecture.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check architecture availability", arch_ref);
+        InstanceDescription id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 1", id.getState() == ComponentInstance.VALID);
+
+        ServiceReference cs_ref = ipojoHelper.getServiceReferenceByName(CheckService.class.getName(), instance2.getInstanceName());
+        assertNotNull("Check CheckService availability", cs_ref);
+        CheckService cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        Properties props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 0", ((Boolean) props.get("result")).booleanValue()); // False : no provider
+        assertEquals("check void bind invocation - 0", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 0", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 0", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 0", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 0", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 0", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 0", ((Integer) props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 0", ((Long) props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 0", ((Double) props.get("double")).doubleValue(), 0.0, 0);
+
+        fooProvider1.start();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 2", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 1", ((Boolean) props.get("result")).booleanValue()); // True, a provider is here
+        assertEquals("check void bind invocation - 1", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 1", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 1", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 1", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 1", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 1", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 1", ((Integer) props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 1", ((Long) props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 1", ((Double) props.get("double")).doubleValue(), 1.0, 0);
+
+        fooProvider2.start();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 3", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 2", ((Boolean) props.get("result")).booleanValue()); // True, two providers are here
+        assertEquals("check void bind invocation - 2", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 2", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 2", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 2", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 2", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 2", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 2", ((Integer) props.get("int")).intValue(), 2);
+        assertEquals("Check FS invocation (long) - 2", ((Long) props.get("long")).longValue(), 2);
+        assertEquals("Check FS invocation (double) - 2", ((Double) props.get("double")).doubleValue(), 2.0, 0);
+
+        fooProvider1.stop();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 4", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertTrue("check CheckService invocation - 3", ((Boolean) props.get("result")).booleanValue()); // True, it still one provider.
+        assertEquals("check void bind invocation - 3", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 3", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 3", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 3", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 3", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 3", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 3", ((Integer) props.get("int")).intValue(), 1);
+        assertEquals("Check FS invocation (long) - 3", ((Long) props.get("long")).longValue(), 1);
+        assertEquals("Check FS invocation (double) - 3", ((Double) props.get("double")).doubleValue(), 1.0, 0);
+
+        fooProvider2.stop();
+
+        id = ((Architecture) osgiHelper.getServiceObject(arch_ref)).getInstanceDescription();
+        assertTrue("Check instance validity - 5", id.getState() == ComponentInstance.VALID);
+
+        cs = (CheckService) osgiHelper.getServiceObject(cs_ref);
+        props = cs.getProps();
+        //Check properties
+        assertFalse("check CheckService invocation - 4", ((Boolean) props.get("result")).booleanValue()); // False, no more provider.
+        assertEquals("check void bind invocation - 4", ((Integer) props.get("voidB")).intValue(), 0);
+        assertEquals("check void unbind callback invocation - 4", ((Integer) props.get("voidU")).intValue(), 0);
+        assertEquals("check object bind callback invocation - 4", ((Integer) props.get("objectB")).intValue(), 0);
+        assertEquals("check object unbind callback invocation - 4", ((Integer) props.get("objectU")).intValue(), 0);
+        assertEquals("check ref bind callback invocation - 4", ((Integer) props.get("refB")).intValue(), 0);
+        assertEquals("check ref unbind callback invocation - 4", ((Integer) props.get("refU")).intValue(), 0);
+        assertEquals("Check FS invocation (int) - 4", ((Integer) props.get("int")).intValue(), 0);
+        assertEquals("Check FS invocation (long) - 4", ((Long) props.get("long")).longValue(), 0);
+        assertEquals("Check FS invocation (double) - 4", ((Double) props.get("double")).doubleValue(), 0.0, 0);
+    }
+
+}



Mime
View raw message