FELIX-3559 Fix factory components whose newInstances are services referred to by other components

git-svn-id: https://svn.apache.org/repos/asf/felix/trunk@1371859 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/scr/src/test/resources/integration_test_simple_components.xml b/scr/src/test/resources/integration_test_simple_components.xml
index e1b710d..04f0f9d 100644
--- a/scr/src/test/resources/integration_test_simple_components.xml
+++ b/scr/src/test/resources/integration_test_simple_components.xml
@@ -138,4 +138,31 @@
         />
     </scr:component>
 
+    <!-- Component Factory Instances, instance is referred to by another component -->
+    <scr:component name="factory.component.referred"
+        enabled="false"
+        factory="factory.component.factory.referred" >
+        <implementation class="org.apache.felix.scr.integration.components.SimpleServiceImpl" />
+        <service>
+            <provide interface="org.apache.felix.scr.integration.components.SimpleService" />
+        </service>
+    </scr:component>
+
+    <!-- component has a reference to service created by the factory.component.referred factory component-->
+    <scr:component name="ComponentReferringToFactoryObject"
+        enabled="false"
+        immediate="true">
+        <implementation class="org.apache.felix.scr.integration.components.SimpleComponent" />
+        <property name="service.pid" value="ComponentReferringToFactoryObject" />
+        <reference
+            name="ref"
+            interface="org.apache.felix.scr.integration.components.SimpleService"
+            cardinality="1..1"
+            policy="dynamic"
+            bind="bindSimpleService"
+            unbind="unbindSimpleService"
+            target="(service.pid=myFactoryInstance)"
+        />
+    </scr:component>
+
 </components>