我有一個在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