CFEasyMock and ColdSpring/Transfer
Starting a new job and integrating cfEM into an application using ColdSpring and Transfer. The ColdSpring piece is actually quite easy, however the Transfer portion is rather interesting, since Transfer doesn't require you to actually code a component. I will keep you posted.
For ColdSpring, I have created a separate coldspring.xml file for each test file, with the naming convention "TestFile.coldspring.xml". This allows me to wire the dependencies separately for each test.
As you can see, the MockFactory can easily be wired to produce the desired mock objects.
<bean id="mockFactory" class="easymock.MockFactory" />
<bean id="transactionAPIGateway" factory-bean="mockFactory" factory-method="createMock">
<constructor-arg name="class">
<value>cfc.am.gateway.TransactionAPIGateway</value>
</constructor-arg>
</bean>
<bean id="identitySyncGateway" factory-bean="mockFactory" factory-method="createMock">
<constructor-arg name="class">
<value>cfc.am.gateway.IdentitySyncGateway</value>
</constructor-arg>
</bean>
<bean id="transactionAPIService" class="cfc.am.service.TransactionAPIService">
<property name="transactionAPIGateway">
<ref bean="transactionAPIGateway" />
</property>
<property name="syncGateway">
<ref bean="syncGateway" />
</property>
</bean>
</beans>

There are no comments for this entry.
[Add Comment]