cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reinhard Poetz <reinh...@apache.org>
Subject Re: ContainerTestCase: How to add custom bean definitions?
Date Wed, 28 Mar 2007 20:37:37 GMT
Reinhard Poetz wrote:
> 
> Does ContainerTestCase provide some facility to add custom bean 
> definitions similar to the *.xtest mechanism?

After studying the code and not finding any hint of some already existing 
machanism, I added these  lines to the AbstractTestCase:

+        ClassPathResource cpr = new 
ClassPathResource(getClass().getName().replace('.', '/') + ".spring.xml");
+        if(cpr.exists()) {
+            this.beanFactory = new XmlBeanFactory(cpr);
+        } else {
+            this.beanFactory = new DefaultListableBeanFactory();

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------

Mime
View raw message