geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r452802 - in /geronimo/xbean/trunk/xbean-spring-v2b/src: main/java/org/apache/xbean/spring/context/v2b/ test/java/org/apache/xbean/spring/context/ test/java/org/apache/xbean/spring/example/ test/resources/org/apache/xbean/spring/context/
Date Wed, 04 Oct 2006 09:03:59 GMT
Author: gnodet
Date: Wed Oct  4 02:03:58 2006
New Revision: 452802

URL: http://svn.apache.org/viewvc?view=rev&rev=452802
Log:
XBEAN-56: Unable to parse nested custom spring tags (defined using spring2 handlers)

Added:
    geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/context/SpringExtensionTest.java
    geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/example/DummyBean.java
    geronimo/xbean/trunk/xbean-spring-v2b/src/test/resources/org/apache/xbean/spring/context/spring-extension.xml
Modified:
    geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanBeanDefinitionParserDelegate.java
    geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java

Modified: geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanBeanDefinitionParserDelegate.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanBeanDefinitionParserDelegate.java?view=diff&rev=452802&r1=452801&r2=452802
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanBeanDefinitionParserDelegate.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanBeanDefinitionParserDelegate.java
Wed Oct  4 02:03:58 2006
@@ -16,6 +16,7 @@
  */
 package org.apache.xbean.spring.context.v2b;
 
+import java.lang.reflect.InvocationTargetException;
 import java.lang.reflect.Method;
 
 import org.apache.xbean.spring.context.impl.PropertyEditorHelper;
@@ -92,6 +93,9 @@
             mth.setAccessible(true);
             return mth.invoke(this, new Object[] { candidateEle });
         } catch (Exception e) {
+            if (e instanceof InvocationTargetException && e.getCause() instanceof
RuntimeException) {
+                throw (RuntimeException) e.getCause();
+            }
             throw new IllegalStateException("Unable to invoke parseNestedCustomElement method",
e);
         }
     }

Modified: geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java?view=diff&rev=452802&r1=452801&r2=452802
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/main/java/org/apache/xbean/spring/context/v2b/XBeanNamespaceHandler.java
Wed Oct  4 02:03:58 2006
@@ -487,7 +487,7 @@
                     else {
                         propertyName = metadata.getFlatCollectionProperty(getLocalName(element),
localName);
                         if (propertyName != null) {
-                            Object def = parseBeanFromExtensionElement(childElement);
+                            Object def = parserContext.getDelegate().parseCustomElement(childElement,
true);
                             PropertyValue pv = definition.getBeanDefinition().getPropertyValues().getPropertyValue(propertyName);
                             if (pv != null) {
                                 Collection l = (Collection) pv.getValue();
@@ -661,7 +661,7 @@
                         return parserContext.getDelegate().parsePropertySubElement(childElement,
null);
                     }
                 } else {
-                    Object value = parseBeanFromExtensionElement(childElement);
+                    Object value = parserContext.getDelegate().parseCustomElement(childElement,
true);
                     if (value != null) {
                         return value;
                     }

Added: geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/context/SpringExtensionTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/context/SpringExtensionTest.java?view=auto&rev=452802
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/context/SpringExtensionTest.java
(added)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/context/SpringExtensionTest.java
Wed Oct  4 02:03:58 2006
@@ -0,0 +1,36 @@
+/**
+ * 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.
+ */
+package org.apache.xbean.spring.context;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+/**
+ * 
+ * @author gnodet
+ * @since 2.7
+ */
+public class SpringExtensionTest extends SpringTestSupport {
+
+    public void test() {
+        
+    }
+    
+    protected AbstractXmlApplicationContext createApplicationContext() {
+        return new ClassPathXmlApplicationContext("org/apache/xbean/spring/context/spring-extension.xml");
+    }
+
+}

Added: geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/example/DummyBean.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/example/DummyBean.java?view=auto&rev=452802
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/example/DummyBean.java
(added)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/test/java/org/apache/xbean/spring/example/DummyBean.java
Wed Oct  4 02:03:58 2006
@@ -0,0 +1,42 @@
+/**
+ * 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.
+ */
+package org.apache.xbean.spring.example;
+
+/**
+ * @org.apache.xbean.XBean element="dummy"
+ * @author gnodet
+ * @since 2.7
+ */
+public class DummyBean {
+
+    private Object inner;
+
+    /**
+     * @return the inner
+     */
+    public Object getInner() {
+        return inner;
+    }
+
+    /**
+     * @param inner the inner to set
+     */
+    public void setInner(Object inner) {
+        this.inner = inner;
+    }
+    
+}

Added: geronimo/xbean/trunk/xbean-spring-v2b/src/test/resources/org/apache/xbean/spring/context/spring-extension.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2b/src/test/resources/org/apache/xbean/spring/context/spring-extension.xml?view=auto&rev=452802
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2b/src/test/resources/org/apache/xbean/spring/context/spring-extension.xml
(added)
+++ geronimo/xbean/trunk/xbean-spring-v2b/src/test/resources/org/apache/xbean/spring/context/spring-extension.xml
Wed Oct  4 02:03:58 2006
@@ -0,0 +1,29 @@
+<?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:b="http://xbean.apache.org/schemas/pizza"
+       xmlns:util="http://www.springframework.org/schema/util">
+  
+  <b:dummy>
+    <b:inner>
+      <util:constant static-field="java.sql.Connection.TRANSACTION_SERIALIZABLE"/>
+    </b:inner>
+  </b:dummy>
+  
+</beans>
\ No newline at end of file



Mime
View raw message