2012-02-23 112 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; 
}