我有一个在CamelRoutes.xml
中定义的路由,我想通过使用http://camel.apache.org/mock.html底部描述的包装技术来测试它们。使用弹簧配置测试骆驼的问题
我CamelRoutes.xml
<route autoStartup="true" xmlns="http://camel.apache.org/schema/spring">
<from uri="direct:start"/>
<to uri="direct:end"/>
</route>
因此,我创建CamelRoutesTest.xml
包含:
<import resource="CamelRoutes.xml"/>
<bean id="mockAllEndpoints" class="org.apache.camel.impl.InterceptSendToMockEndpointStrategy"/>
,但我不知道怎么说都加载在Spring的XML,并提供访问模拟端点创建一个测试。
如果我使用..
@ContextConfiguration(locations=("/CamelRoutesTest"))
public class CamelTest extends AbstractJUnit38SpringContextTests
}
然后我不知道如何得到模拟端点
如果我使用..
public class CamelTest extends CamelTestSupport
}
然后我不知道如何加载我的骆驼环境..
我似乎无法找到一个例子在使用CamelTestSupport
的网站上进行测试,并从spring xml加载路由。
我常在这里如果更新我的问题/当我得到答案的其他地方。目前,我仍然缺乏一个体面的例子来说明如何正确地模拟我的路线,以便我的测试不会触及外部系统。 – Tom 2011-03-29 07:53:17