cocoon-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From reinh...@apache.org
Subject svn commit: r523361 - /cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java
Date Wed, 28 Mar 2007 15:17:04 GMT
Author: reinhard
Date: Wed Mar 28 08:17:00 2007
New Revision: 523361

URL: http://svn.apache.org/viewvc?view=rev&rev=523361
Log:
better check for existance than using try/catch

Modified:
    cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java

Modified: cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java
URL: http://svn.apache.org/viewvc/cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java?view=diff&rev=523361&r1=523360&r2=523361
==============================================================================
--- cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java (original)
+++ cocoon/trunk/core/cocoon-core/src/test/java/org/apache/cocoon/AbstractTestCase.java Wed
Mar 28 08:17:00 2007
@@ -145,14 +145,11 @@
     }
 
     protected void createBeanFactory() throws Exception {
-        try {
-            ClassPathResource cpr = new ClassPathResource(getClass().getName().replace('.',
'/') + ".spring.xml");
-            this.beanFactory = new XmlBeanFactory(cpr);
-        } catch (Exception e) {
-            if (e instanceof IOException) {
-                this.beanFactory = new DefaultListableBeanFactory();
-            }
-            throw e;
+        ClassPathResource cpr = new ClassPathResource(getClass().getName().replace('.', '/')
+ ".spring.xml");
+        if(cpr.exists()) {
+            this.beanFactory = new XmlBeanFactory(cpr);                
+        } else {
+            this.beanFactory = new DefaultListableBeanFactory();
         }
         this.addSettings();
     }



Mime
View raw message