2012-02-23 159 views
1

我想弄清楚如何擺脫顯示在我的JUnit測試中的警告。該測試擴展了CamelTestSupport,但所有的測試方法拋出Apache Camel JUnit測試警告

WARN : Caught unhandled exception while processing ExchangedId:... 

java.lang.IllegalArgumentException: connectionFactory must be specified 

任何想法如何解決這個問題?

+0

您可以發佈您的整個單元測試?可能只是缺少JMS connectionFactory設置,請參閱http://camel.apache.org/jms.html – 2012-02-23 18:05:25

回答

3

如果你使用JMS/AMQ,那麼你可能需要把它添加到您的安裝組件/ connectionFactory的...

protected CamelContext createCamelContext() throws Exception { 
    CamelContext camelContext = super.createCamelContext(); 
    String url = "vm://test-broker?broker.persistent=false&broker.useJmx=false"; 
    ConnectionFactory connectionFactory = new ActiveMQConnectionFactory(url); 
    camelContext.addComponent("activemq", JmsComponent.jmsComponentAutoAcknowledge(connectionFactory)); 
    return camelContext; 
}