You are viewing a plain text version of this content. The canonical link for it is here.
Posted to scm@geronimo.apache.org by gn...@apache.org on 2009/04/22 14:37:59 UTC
svn commit: r767491 - in /geronimo/sandbox/blueprint/blueprint-core/src/test:
java/org/apache/geronimo/blueprint/WiringTest.java resources/test-wiring.xml
Author: gnodet
Date: Wed Apr 22 12:37:58 2009
New Revision: 767491
URL: http://svn.apache.org/viewvc?rev=767491&view=rev
Log:
Add a test ensuring prototype components are created multiple times when requested
Modified:
geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml
Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java?rev=767491&r1=767490&r2=767491&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/java/org/apache/geronimo/blueprint/WiringTest.java Wed Apr 22 12:37:58 2009
@@ -57,10 +57,16 @@
assertNotNull(pojoa.getList());
assertEquals("list value", pojoa.getList().get(0));
- assertEquals(pojob, pojoa.getList().get(1));
assertEquals(new Integer(55), pojoa.getList().get(2));
assertEquals(URI.create("http://geronimo.apache.org"), pojoa.getList().get(3));
-
+ Object c0 = pojoa.getList().get(1);
+ Object c1 = pojoa.getList().get(4);
+ assertNotNull(c0);
+ assertNotNull(c1);
+ assertEquals(PojoB.class, c0.getClass());
+ assertEquals(PojoB.class, c1.getClass());
+ assertNotSame(c0, c1);
+
assertNotNull(pojoa.getArray());
assertEquals("list value", pojoa.getArray()[0]);
assertEquals(pojob, pojoa.getArray()[1]);
Modified: geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml?rev=767491&r1=767490&r2=767491&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml (original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/test/resources/test-wiring.xml Wed Apr 22 12:37:58 2009
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<components xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 ../../main/resources/org/apache/felix/blueprint/blueprint.xsd"
+ xsi:schemaLocation="http://www.osgi.org/xmlns/blueprint/v1.0.0 ../../main/resources/org/apache/geronimo/blueprint/blueprint.xsd"
default-availability="mandatory"
default-init-method = "init"
default-destroy-method = "destroy" >
@@ -18,7 +18,7 @@
<entry key="key2" value="value2"/>
</service-properties>
</service>
-
+
<component id="pojoC" class="org.apache.geronimo.blueprint.pojos.PojoB" scope = "prototype">
<property name="uri" value="urn:myuri" />
</component>
@@ -44,9 +44,10 @@
<property name="list">
<list>
<value>list value</value>
- <ref component="pojoB" />
+ <ref component="pojoC" />
<value type="java.lang.Integer">55</value>
<value type="java.net.URI">http://geronimo.apache.org</value>
+ <ref component="pojoC" />
</list>
</property>
<property name="array">