【发布时间】:2012-05-25 21:02:56
【问题描述】:
我在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 加载路由的示例测试。
【问题讨论】:
标签: unit-testing spring apache-camel