Anthony,
it sounds like you're running into the same exact thing that I did a
while back. If so, I'd say that Coldspring is behaving as it should.
See if this sounds at all familiar:
http://www.dougboude.com/blog/1/2007/03/Coldspring-automagic-lesson.cfm
Doug :0)
On 6/11/07, Anthony Israel-Davis <[EMAIL PROTECTED]> wrote:
I'm running into a problem and I don't know if it's a problem in my code or
a misunderstanding about how the Coldspring beanfactory wires up components.
I'm using version 1.1.1.
I have two subclasses that use components that are composed into the base
class. I'm unit testing using CFCUnit, but my tests are returning errors
saying "ComposedClassA is undefined in variables." despite a
setComposedClassA method in the base class.
My bean definition looks something like this:
<beans>
<bean id="ComposedClassA" class="path.to.ComposedClassA" />
<bean id="ComposedClassB" class="path.to.ComposedClassB" />
<bean id="MockComposedClassA" class="path.to.MockComposedClassA" />
<bean id="MockComposedClassb" class="path.to.MockComposedClassB" />
<bean id="BaseClass" class="path.to.BaseClass">
<property name="ComposedClassA">
<ref bean="MockComposedClassA"/>
</property>
<property name="ComposedClassB">
<ref bean="MockComposedClassB"/>
</property>
</bean>
<bean id="SubClassA" class="path.to.SubClassA"/>
<bean id="SubClassB" class="path.to.SubClassB" />
</beans>
There are getters and setters in BaseClass for ComposedClass(A-B), so my
question is when I call local.beanFactory.getBean('SubClassA') (which
extends BaseClass) does Coldspring call the BaseClass' setters? It seems to
not call inherited setters, but if, in the config file, I put the properties
in SubClassA it configures the bean correctly.
So am I doing something wrong or is Coldspring performing as expected? I
couldn't find anything in the documentation or in the forums specifically
about this, so any help would be appreciated.
Thanks,
anthony