geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ga...@apache.org
Subject svn commit: r769590 - in /geronimo/sandbox/blueprint/blueprint-core/src: main/java/org/apache/geronimo/blueprint/context/Parser.java test/java/org/apache/geronimo/blueprint/WiringTest.java test/resources/test-wiring.xml
Date Tue, 28 Apr 2009 23:33:29 GMT
Author: gawor
Date: Tue Apr 28 23:33:29 2009
New Revision: 769590

URL: http://svn.apache.org/viewvc?rev=769590&view=rev
Log:
support for inlined prop values

Modified:
    geronimo/sandbox/blueprint/blueprint-core/src/main/java/org/apache/geronimo/blueprint/context/Parser.java
    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=769590&r1=769589&r2=769590&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
Tue Apr 28 23:33:29 2009
@@ -651,11 +651,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/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=769590&r1=769589&r2=769590&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
Tue Apr 28 23:33:29 2009
@@ -90,6 +90,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=769590&r1=769589&r2=769590&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 Tue Apr 28
23:33:29 2009
@@ -56,6 +56,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