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 2006/06/06 14:28:57 UTC
svn commit: r412106 - in /geronimo/xbean/branches/spring2/trunk:
xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/
xbean-spring-itests/ xbean-spring-itests/1.2.4/
xbean-spring-itests/1.2.4/src/ xbean-spring-itests/1.2.4/src/test/ ...
Author: gnodet
Date: Tue Jun 6 05:28:54 2006
New Revision: 412106
URL: http://svn.apache.org/viewvc?rev=412106&view=rev
Log:
Fix latest incompatibilities with spring 1.2.x versions
and add integration tests for each supported spring version.
Added:
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/Spring124Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/Spring125Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/Spring126Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/Spring127Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/Spring128Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/Spring20m5Test.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/SpringTestSupport.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/PizzaService.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/RestaurantService.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/
geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/restaurant-xbean.xml
Modified:
geronimo/xbean/branches/spring2/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/QNameHelper.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/pom.xml
geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java
Modified: geronimo/xbean/branches/spring2/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/QNameHelper.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/QNameHelper.java?rev=412106&r1=412105&r2=412106&view=diff
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/QNameHelper.java (original)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-common/src/main/java/org/apache/xbean/spring/context/impl/QNameHelper.java Tue Jun 6 05:28:54 2006
@@ -29,6 +29,7 @@
import javax.xml.namespace.QName;
import java.beans.PropertyDescriptor;
+import java.lang.reflect.Method;
import java.util.Iterator;
import java.util.List;
@@ -96,7 +97,7 @@
Object value = propertyValue.getValue();
if (value instanceof String) {
propertyValues.removePropertyValue(propertyValue);
- propertyValues.addPropertyValue(name, createQName(element, (String) value));
+ addPropertyValue(propertyValues, name, createQName(element, (String) value));
}
}
} else if (descriptor.getPropertyType().isAssignableFrom(QName[].class)) {
@@ -122,4 +123,27 @@
}
}
}
+
+ // Fix Spring 1.2.6 to 1.2.7 binary incompatibility.
+ // The addPropertyValueMethod has changed to return a
+ // value instead of void.
+ // So use reflectiom to handle both cases.
+ private static final Method addPropertyValueMethod;
+ static {
+ try {
+ addPropertyValueMethod = MutablePropertyValues.class.getMethod(
+ "addPropertyValue",
+ new Class[] { String.class, Object.class });
+ } catch (Exception e) {
+ throw new RuntimeException("Unable to find MutablePropertyValues:addPropertyValue", e);
+ }
+ }
+ public static void addPropertyValue(MutablePropertyValues values, String name, Object value) {
+ try {
+ addPropertyValueMethod.invoke(values, new Object[] { name, value });
+ } catch (Exception e) {
+ throw new RuntimeException("Error adding property definition", e);
+ }
+ }
+
}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-124</artifactId>
+ <name>XBean :: Spring :: ITests :: 124</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>1.2.4</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/Spring124Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/Spring124Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/Spring124Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.4/src/test/java/org/apache/xbean/spring/context/Spring124Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring124Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,44 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-125</artifactId>
+ <name>XBean :: Spring :: ITests :: 125</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>1.2.5</version>
+ <exclusions>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-support</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-orm</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-hibernate</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-remoting</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-core</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/Spring125Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/Spring125Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/Spring125Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.5/src/test/java/org/apache/xbean/spring/context/Spring125Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring125Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-126</artifactId>
+ <name>XBean :: Spring :: ITests :: 126</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>1.2.6</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/Spring126Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/Spring126Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/Spring126Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.6/src/test/java/org/apache/xbean/spring/context/Spring126Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring126Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-127</artifactId>
+ <name>XBean :: Spring :: ITests :: 127</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>1.2.7</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/Spring127Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/Spring127Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/Spring127Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.7/src/test/java/org/apache/xbean/spring/context/Spring127Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring127Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-128</artifactId>
+ <name>XBean :: Spring :: ITests :: 128</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>1.2.8</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/Spring128Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/Spring128Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/Spring128Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/1.2.8/src/test/java/org/apache/xbean/spring/context/Spring128Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring128Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-20m5</artifactId>
+ <name>XBean :: Spring :: ITests :: 20m5</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring</artifactId>
+ <version>2.0-m5</version>
+ </dependency>
+ </dependencies>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/Spring20m5Test.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/Spring20m5Test.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/Spring20m5Test.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/2.0-m5/src/test/java/org/apache/xbean/spring/context/Spring20m5Test.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,22 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+public class Spring20m5Test extends RestaurantUsingXBeanTest {
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/pom.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/pom.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/pom.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8"?><project>
+ <parent>
+ <artifactId>xbean-spring-itests</artifactId>
+ <groupId>org.apache.xbean</groupId>
+ <version>2.4-SNAPSHOT</version>
+ </parent>
+ <modelVersion>4.0.0</modelVersion>
+ <artifactId>xbean-spring-itests-core</artifactId>
+ <name>XBean :: Spring :: ITests :: Core</name>
+ <version>2.4-SNAPSHOT</version>
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>xbean-spring</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>3.8.1</version>
+ </dependency>
+ </dependencies>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.xbean</groupId>
+ <artifactId>maven-xbean-plugin</artifactId>
+ <version>${version}</version>
+ <executions>
+ <execution>
+ <configuration>
+ <namespace>http://xbean.apache.org/schemas/pizza</namespace>
+ </configuration>
+ <goals>
+ <goal>mapping</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,92 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.apache.xbean.spring.example.RestaurantService;
+import org.apache.xbean.spring.example.PizzaService;
+
+import javax.xml.namespace.QName;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * @author James Strachan
+ * @version $Id$
+ * @since 2.0
+ */
+public class RestaurantUsingXBeanTest extends SpringTestSupport {
+
+ private static final Log log = LogFactory.getLog(RestaurantUsingXBeanTest.class);
+
+ public void testPizza() throws Exception {
+ RestaurantService restaurant = (RestaurantService) getBean("restaurant");
+
+ QName name = restaurant.getServiceName();
+ assertNotNull("Name is null", name);
+ assertEquals("Namespace URI", "http://acme.com", name.getNamespaceURI());
+ assertEquals("localName", "xyz", name.getLocalPart());
+ assertEquals("prefix", "foo", name.getPrefix());
+
+ // dinners (1-many using list)
+ List dinners = restaurant.getDinnerMenu();
+ assertNotNull("dinners is null!", dinners);
+ assertEquals("dinners size: " + dinners, 2, dinners.size());
+
+ PizzaService pizza = (PizzaService) dinners.get(0);
+ assertEquals("topping", "Ham", pizza.getTopping());
+ assertEquals("cheese", "Mozzarella", pizza.getCheese());
+ assertEquals("size", 15, pizza.getSize());
+
+ pizza = (PizzaService) dinners.get(1);
+ assertEquals("topping", "Eggs", pizza.getTopping());
+ assertEquals("cheese", "Mozzarella", pizza.getCheese());
+ assertEquals("size", 16, pizza.getSize());
+
+ // lunches (1-many using array)
+ PizzaService[] lunches = restaurant.getLunchMenu();
+ assertNotNull("lunches is null!", lunches);
+ assertEquals("lunches size: " + lunches, 1, lunches.length);
+
+ pizza = lunches[0];
+ assertEquals("topping", "Chicken", pizza.getTopping());
+ assertEquals("cheese", "Brie", pizza.getCheese());
+ assertEquals("size", 17, pizza.getSize());
+
+
+ // favourite (1-1)
+ pizza = restaurant.getFavourite();
+ assertNotNull("Pizza is null!", pizza);
+ pizza.makePizza();
+
+ assertEquals("topping", "Salami", pizza.getTopping());
+ assertEquals("cheese", "Edam", pizza.getCheese());
+ assertEquals("size", 17, pizza.getSize());
+
+ URI uri = restaurant.getUri();
+ assertNotNull("URI is null", uri);
+ assertEquals("URI", new URI("http://cheese.com"), uri);
+ }
+
+ protected AbstractXmlApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext("org/apache/xbean/spring/context/restaurant-xbean.xml");
+ }
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/SpringTestSupport.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/SpringTestSupport.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/SpringTestSupport.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/SpringTestSupport.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,57 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.springframework.context.support.AbstractXmlApplicationContext;
+
+import junit.framework.TestCase;
+
+/**
+ * A useful base class for testing spring based utilities.
+ *
+ * @author James Strachan
+ * @version $Id$
+ * @since 2.0
+ */
+public abstract class SpringTestSupport extends TestCase {
+ protected transient Log log = LogFactory.getLog(getClass());
+
+ protected AbstractXmlApplicationContext context;
+
+ protected void setUp() throws Exception {
+ context = createApplicationContext();
+ assertNotNull("ApplicationContext is null!", context);
+ }
+
+ protected void tearDown() throws Exception {
+ if (context != null) {
+ log.info("Closing down the spring context");
+ context.destroy();
+ }
+ }
+
+ protected Object getBean(String name) {
+ Object answer = answer = context.getBean(name);
+ assertNotNull("Could not find object in Spring for key: " + name, answer);
+ return answer;
+ }
+
+ protected abstract AbstractXmlApplicationContext createApplicationContext();
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/PizzaService.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/PizzaService.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/PizzaService.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/PizzaService.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,83 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+/**
+ * @org.apache.xbean.XBean element="pizza"
+ * description="This is a tasty Pizza"
+ *
+ * @author James Strachan
+ * @version $Id$
+ * @since 2.0
+ */
+
+// START SNIPPET: bean
+public class PizzaService {
+
+ private static final Log log = LogFactory.getLog(PizzaService.class);
+
+ private String topping;
+ private String cheese;
+ private int size;
+ private double price;
+
+ public void makePizza() {
+ log.info("Making a pizza with topping: " + topping + " cheese: " + cheese + " with size: " + size);
+ }
+
+ public String getCheese() {
+ return cheese;
+ }
+
+ public void setCheese(String cheese) {
+ this.cheese = cheese;
+ }
+
+ public double getPrice() {
+ return price;
+ }
+
+ public void setPrice(double price) {
+ this.price = price;
+ }
+
+ public int getSize() {
+ return size;
+ }
+
+ public void setSize(int size) {
+ this.size = size;
+ }
+
+ /**
+ * @org.apache.xbean.Property alias="myTopping"
+ */
+ public String getTopping() {
+ return topping;
+ }
+
+ public void setTopping(String topping) {
+ this.topping = topping;
+ }
+
+}
+// END SNIPPET: bean
+
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/RestaurantService.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/RestaurantService.java?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/RestaurantService.java (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/example/RestaurantService.java Tue Jun 6 05:28:54 2006
@@ -0,0 +1,86 @@
+/**
+ *
+ * Copyright 2005-2006 The Apache Software Foundation or its licensors, as applicable.
+ *
+ * Licensed 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;
+
+import javax.xml.namespace.QName;
+
+import java.net.URI;
+import java.util.List;
+
+/**
+ * An owner POJO used for testing out nested properties
+ *
+ * @org.apache.xbean.XBean namespace="http://xbean.apache.org/schemas/pizza" element="restaurant"
+ * description="A Restaurant thingy"
+ *
+ * @author James Strachan
+ * @version $Id$
+ * @since 2.0
+ */
+public class RestaurantService {
+
+ private PizzaService favourite;
+ private List dinnerMenu;
+ private PizzaService[] lunchMenu;
+ private QName serviceName;
+ private URI uri;
+
+ /**
+ * @org.apache.xbean.Property nestedType="org.apache.xbean.spring.example.PizzaService"
+ */
+ public List getDinnerMenu() {
+ return dinnerMenu;
+ }
+
+ public void setDinnerMenu(List dinnerMenu) {
+ this.dinnerMenu = dinnerMenu;
+ }
+
+ public PizzaService[] getLunchMenu() {
+ return lunchMenu;
+ }
+
+ public void setLunchMenu(PizzaService[] lunchMenu) {
+ this.lunchMenu = lunchMenu;
+ }
+
+ public PizzaService getFavourite() {
+ return favourite;
+ }
+
+ public void setFavourite(PizzaService favourite) {
+ this.favourite = favourite;
+ }
+
+ public QName getServiceName() {
+ return serviceName;
+ }
+
+ public void setServiceName(QName name) {
+ this.serviceName = name;
+ }
+
+ public URI getUri() {
+ return uri;
+ }
+
+ public void setUri(URI uri) {
+ this.uri = uri;
+ }
+
+}
Added: geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/restaurant-xbean.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/restaurant-xbean.xml?rev=412106&view=auto
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/restaurant-xbean.xml (added)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-itests/core/src/main/resources/org/apache/xbean/spring/context/restaurant-xbean.xml Tue Jun 6 05:28:54 2006
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- START SNIPPET: xml -->
+<beans>
+
+ <restaurant id="restaurant" xmlns="http://xbean.apache.org/schemas/pizza" xmlns:foo="http://acme.com" serviceName="foo:xyz" uri="http://cheese.com">
+ <dinnerMenu>
+ <pizza myTopping="Ham" cheese="Mozzarella" size="15"/>
+ <pizza myTopping="Eggs" cheese="Mozzarella" size="16"/>
+ </dinnerMenu>
+
+ <lunchMenu>
+ <pizza myTopping="Chicken" cheese="Brie" size="17"/>
+ </lunchMenu>
+
+ <favourite>
+ <pizza myTopping="Salami" cheese="Edam" size="17"/>
+ </favourite>
+ </restaurant>
+</beans>
+<!-- END SNIPPET: xml -->
Modified: geronimo/xbean/branches/spring2/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java?rev=412106&r1=412105&r2=412106&view=diff
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java (original)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-v1/src/main/java/org/apache/xbean/spring/context/v1/XBeanXmlBeanDefinitionParser.java Tue Jun 6 05:28:54 2006
@@ -40,6 +40,7 @@
import org.apache.xbean.spring.context.impl.NamedConstructorArgs;
import org.apache.xbean.spring.context.impl.NamespaceHelper;
import org.apache.xbean.spring.context.impl.PropertyEditorHelper;
+import org.apache.xbean.spring.context.impl.QNameHelper;
import org.apache.xbean.spring.context.impl.QNameReflectionHelper;
import org.springframework.beans.MutablePropertyValues;
import org.springframework.beans.PropertyValue;
@@ -302,27 +303,10 @@
String localName, String value) {
String propertyName = metadata.getPropertyName(getLocalName(element), localName);
if (propertyName != null) {
- try {
- addPropertyValueMethod.invoke(definition.getBeanDefinition().getPropertyValues(),
- new Object[] { propertyName, getValue(value) });
- } catch (Exception e) {
- throw new RuntimeException("Error adding property definition", e);
- }
- }
- }
-
- // Fix Spring 1.2.6 to 1.2.7 binary incompatibility.
- // The addPropertyValueMethod has changed to return a
- // value instead of void.
- // So use reflectiom to handle both cases.
- private static final Method addPropertyValueMethod;
- static {
- try {
- addPropertyValueMethod = MutablePropertyValues.class.getMethod(
- "addPropertyValue",
- new Class[] { String.class, Object.class });
- } catch (Exception e) {
- throw new RuntimeException("Unable to find MutablePropertyValues:addPropertyValue", e);
+ QNameHelper.addPropertyValue(
+ definition.getBeanDefinition().getPropertyValues(),
+ propertyName,
+ getValue(value));
}
}
@@ -420,7 +404,10 @@
}
if (value != null) {
- definition.getBeanDefinition().getPropertyValues().addPropertyValue(propertyName, value);
+ QNameHelper.addPropertyValue(
+ definition.getBeanDefinition().getPropertyValues(),
+ propertyName,
+ value);
}
else
{
Modified: geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/pom.xml
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/pom.xml?rev=412106&r1=412105&r2=412106&view=diff
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/pom.xml (original)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/pom.xml Tue Jun 6 05:28:54 2006
@@ -55,6 +55,7 @@
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>2.0-m5</version>
+ <optional>true</optional>
</dependency>
<dependency>
<groupId>mx4j</groupId>
Modified: geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java?rev=412106&r1=412105&r2=412106&view=diff
==============================================================================
--- geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java (original)
+++ geronimo/xbean/branches/spring2/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanNamespaceHandler.java Tue Jun 6 05:28:54 2006
@@ -379,27 +379,8 @@
String localName, String value) {
String propertyName = metadata.getPropertyName(getLocalName(element), localName);
if (propertyName != null) {
- try {
- addPropertyValueMethod.invoke(definition.getBeanDefinition().getPropertyValues(),
- new Object[] { propertyName, getValue(value) });
- } catch (Exception e) {
- throw new RuntimeException("Error adding property definition", e);
- }
- }
- }
-
- // Fix Spring 1.2.6 to 1.2.7 binary incompatibility.
- // The addPropertyValueMethod has changed to return a
- // value instead of void.
- // So use reflectiom to handle both cases.
- private static final Method addPropertyValueMethod;
- static {
- try {
- addPropertyValueMethod = MutablePropertyValues.class.getMethod(
- "addPropertyValue",
- new Class[] { String.class, Object.class });
- } catch (Exception e) {
- throw new RuntimeException("Unable to find MutablePropertyValues:addPropertyValue", e);
+ definition.getBeanDefinition().getPropertyValues().addPropertyValue(
+ propertyName, getValue(value));
}
}