geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From gno...@apache.org
Subject svn commit: r427307 - in /geronimo/xbean/trunk: xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java
Date Mon, 31 Jul 2006 21:51:00 GMT
Author: gnodet
Date: Mon Jul 31 14:51:00 2006
New Revision: 427307

URL: http://svn.apache.org/viewvc?rev=427307&view=rev
Log:
XBEAN-30: NPE using XBeanHelper.createBeanDefinitionReader and spring 2.0-rc2

Modified:
    geronimo/xbean/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
    geronimo/xbean/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java

Modified: geronimo/xbean/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java?rev=427307&r1=427306&r2=427307&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-itests/core/src/main/java/org/apache/xbean/spring/context/RestaurantUsingXBeanTest.java
Mon Jul 31 14:51:00 2006
@@ -20,8 +20,10 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.core.io.ClassPathResource;
 import org.apache.xbean.spring.example.RestaurantService;
 import org.apache.xbean.spring.example.PizzaService;
+import org.apache.xbean.spring.context.impl.XBeanXmlBeanFactory;
 
 import javax.xml.namespace.QName;
 
@@ -89,4 +91,10 @@
     protected AbstractXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("org/apache/xbean/spring/context/restaurant-xbean.xml");
     }
+    
+     public void testCreateXBeanXmlBeanFactory() throws Exception {
+        XBeanXmlBeanFactory factory = new XBeanXmlBeanFactory(new ClassPathResource("org/apache/xbean/spring/context/restaurant-xbean.xml"));
+        assertNotNull(factory);
+    }
+ 
 }

Modified: geronimo/xbean/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java
URL: http://svn.apache.org/viewvc/geronimo/xbean/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java?rev=427307&r1=427306&r2=427307&view=diff
==============================================================================
--- geronimo/xbean/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java
(original)
+++ geronimo/xbean/trunk/xbean-spring-v2/src/main/java/org/apache/xbean/spring/context/v2/XBeanXmlBeanDefinitionReader.java
Mon Jul 31 14:51:00 2006
@@ -56,8 +56,10 @@
         this.xmlPreprocessors = xmlPreprocessors;
         setNamespaceAware(true);
         setValidationMode(VALIDATION_NONE);
-        setResourceLoader(applicationContext);
-        setEntityResolver(new ResourceEntityResolver(applicationContext));
+        if (applicationContext != null) {
+            setResourceLoader(applicationContext);
+            setEntityResolver(new ResourceEntityResolver(applicationContext));
+        }
         setDocumentReaderClass(XBeanBeanDefinitionDocumentReader.class);
     }
 



Mime
View raw message