geronimo-xbean-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r671837 - in /geronimo/xbean/trunk/xbean-spring/src: main/java/org/apache/xbean/spring/context/v2c/ test/java/org/apache/xbean/spring/context/ test/resources/org/apache/xbean/spring/context/
Date Thu, 26 Jun 2008 09:52:19 GMT
Author: gnodet
Date: Thu Jun 26 02:52:19 2008
New Revision: 671837

URL: http://svn.apache.org/viewvc?rev=671837&view=rev
Log:
XBEAN-106: Id is required for elements when NOT used as a top-level tag

Added:
    geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanMixedTest.java
      - copied, changed from r669121, geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanTest.java
    geronimo/xbean/trunk/xbean-spring/src/test/resources/org/apache/xbean/spring/context/favorite-xbean-mixed.xml
Modified:
    geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanBeanDefinitionParserDelegate.java

Modified: geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanBeanDefinitionParserDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanBeanDefinitionParserDelegate.java?rev=671837&r1=671836&r2=671837&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanBeanDefinitionParserDelegate.java
(original)
+++ geronimo/xbean/trunk/xbean-spring/src/main/java/org/apache/xbean/spring/context/v2c/XBeanBeanDefinitionParserDelegate.java
Thu Jun 26 02:52:19 2008
@@ -44,7 +44,7 @@
 
     public Object parsePropertySubElement(Element ele, BeanDefinition bd, String defaultTypeClassName)
{
         if (!isDefaultNamespace(ele.getNamespaceURI())) {
-            return internalParseNestedCustomElement(ele);
+            return internalParseNestedCustomElement(ele, bd);
         } 
         else if (ele.getTagName().equals(QNAME_ELEMENT)) {
             return parseQNameElement(ele);
@@ -83,11 +83,11 @@
         return buffer.toString();
     }
     
-    private Object internalParseNestedCustomElement(Element candidateEle) {
+    private Object internalParseNestedCustomElement(Element candidateEle, BeanDefinition
containingBeanDefinition) {
         try {
             Method mth = getClass().getSuperclass().getDeclaredMethod("parseNestedCustomElement",
new Class[] { Element.class, BeanDefinition.class });
             mth.setAccessible(true);
-            return mth.invoke(this, new Object[] { candidateEle, null });
+            return mth.invoke(this, new Object[] { candidateEle, containingBeanDefinition
});
         } catch (Exception e) {
             if (e instanceof InvocationTargetException && e.getCause() instanceof
RuntimeException) {
                 throw (RuntimeException) e.getCause();

Copied: geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanMixedTest.java
(from r669121, geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanTest.java)
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanMixedTest.java?p2=geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanMixedTest.java&p1=geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanTest.java&r1=669121&r2=671837&rev=671837&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanTest.java
(original)
+++ geronimo/xbean/trunk/xbean-spring/src/test/java/org/apache/xbean/spring/context/FavoriteUsingXBeanMixedTest.java
Thu Jun 26 02:52:19 2008
@@ -23,10 +23,10 @@
  * @version $Id$
  * @since 2.0
  */
-public class FavoriteUsingXBeanTest extends FavoriteUsingSpringTest {
+public class FavoriteUsingXBeanMixedTest extends FavoriteUsingSpringTest {
 
     protected AbstractXmlApplicationContext createApplicationContext() {
-        return new ClassPathXmlApplicationContext("org/apache/xbean/spring/context/favorite-xbean.xml");
+        return new ClassPathXmlApplicationContext("org/apache/xbean/spring/context/favorite-xbean-mixed.xml");
     }
 
-}
+}
\ No newline at end of file

Added: geronimo/xbean/trunk/xbean-spring/src/test/resources/org/apache/xbean/spring/context/favorite-xbean-mixed.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring/src/test/resources/org/apache/xbean/spring/context/favorite-xbean-mixed.xml?rev=671837&view=auto
==============================================================================
--- geronimo/xbean/trunk/xbean-spring/src/test/resources/org/apache/xbean/spring/context/favorite-xbean-mixed.xml
(added)
+++ geronimo/xbean/trunk/xbean-spring/src/test/resources/org/apache/xbean/spring/context/favorite-xbean-mixed.xml
Thu Jun 26 02:52:19 2008
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+    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.
+
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:b="http://xbean.apache.org/schemas/pizza">
+
+  <b:favorite id="favoriteService">
+    <property name="favorites">
+      <util:map>
+          <entry key="Dan" value="Grey Goose" />
+          <entry key="IndecisiveDan">
+              <util:list>
+                  <value>Malbec</value>
+                  <bean class="java.lang.Integer">
+                    <constructor-arg value="0"/>
+                  </bean>
+              </util:list>
+          </entry>
+          <entry key="WithInnerBean">
+            <bean class="org.apache.xbean.spring.example.GinService">
+              <property name="name" value="name"/>
+            </bean>
+          </entry>
+      </util:map>
+    </property>
+  </b:favorite>
+
+</beans>



Mime
View raw message