geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r770487 - in /geronimo/sandbox/blueprint/blueprint-core/src: main/java/org/apache/geronimo/blueprint/context/ main/resources/org/apache/geronimo/blueprint/ test/java/org/apache/geronimo/blueprint/ test/resources/
Date Thu, 30 Apr 2009 23:52:55 GMT
Author: gawor
Date: Thu Apr 30 23:52:55 2009
New Revision: 770487

URL: http://svn.apache.org/viewvc?rev=770487&view=rev
Log:
restore props parsing

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
    geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
    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/main/java/org/apache/geronimo/blueprint/context/Parser.java
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java?rev=770487&r1=770486&r2=770487&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
Thu Apr 30 23:52:55 2009
@@ -657,11 +657,13 @@
         if (!element.hasAttribute(KEY_ATTRIBUTE)) {
             throw new ComponentDefinitionException(KEY_ATTRIBUTE + " attribute is required");
         }
-        if (!element.hasAttribute(VALUE_ATTRIBUTE)) {
-            throw new ComponentDefinitionException(VALUE_ATTRIBUTE + " attribute is required");
+        String value = null;
+        if (element.hasAttribute(VALUE_ATTRIBUTE)) {
+            value = element.getAttribute(VALUE_ATTRIBUTE);
+        } else {
+            value = getTextValue(element);
         }
         String key = element.getAttribute(KEY_ATTRIBUTE);
-        String value = element.getAttribute(VALUE_ATTRIBUTE);
         return new MapEntryImpl(new ValueMetadataImpl(key, String.class.getName()),
                                 new ValueMetadataImpl(value, String.class.getName()));
     }

Modified: geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
URL: http://svn.apache.org/viewvc/geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd?rev=770487&r1=770486&r2=770487&view=diff
==============================================================================
--- geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
(original)
+++ geronimo/sandbox/blueprint/blueprint-core/src/main/resources/org/apache/geronimo/blueprint/blueprint.xsd
Thu Apr 30 23:52:55 2009
@@ -346,9 +346,9 @@
    		</xsd:sequence>
 	</xsd:complexType>
 
-    <xsd:complexType name="Tprop">
+    <xsd:complexType name="Tprop" mixed="true">
         <xsd:attribute name="key" type="TstringValue" use="required"/>
-        <xsd:attribute name="value" type="TstringValue" use="required"/>
+        <xsd:attribute name="value" type="TstringValue" use="optional"/>
     </xsd:complexType>
 
     <!-- 'map' element type -->

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=770487&r1=770486&r2=770487&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
Thu Apr 30 23:52:55 2009
@@ -91,6 +91,7 @@
         assertNotNull(pojoa.getProps());
         assertEquals("value1", pojoa.getProps().get("key1"));
         assertEquals("value2", pojoa.getProps().get("2"));
+        assertEquals("bar", pojoa.getProps().get("foo"));
         
         assertNotNull(pojoa.getNumber());
         assertEquals(new BigInteger("10"), pojoa.getNumber());

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=770487&r1=770486&r2=770487&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 Thu Apr 30
23:52:55 2009
@@ -57,6 +57,7 @@
             <props>
                 <prop key="key1" value="value1" />
                 <prop key="2" value="value2" />
+                <prop key="foo">bar</prop>
             </props>
         </property>
         <property name="array">



Mime
View raw message