If you just want to test the camel route, you can use the support classes in camel-test module. It will be more easy to run and test.
When you finished the test , you can put the camel route inside the camel-web.
thats a good idea to get me going. I'd like the tests to run as part of mvn package but I'm trying your idea first.
I've done this:
mvn archetype:generate -DarchetypeGroupId=org.apache.camel.archetypes -DarchetypeArtifactId=camel-archetype-activemq -DarchetypeVersion=2.9.0-RC1
to the pom.xml
add the attached java class to
mvn camel:run and all is well
get the following error:
main] BrokerService ERROR Failed to start ActiveMQ JMS Message Broker. Reason: javax.management.InstanceAlreadyExistsException: org.apache.activemq:BrokerName=localhost,Type=Broker
Any ideas ?
FirstTest.java 1.4 KB
Can you disable the JMX server in you spring configuration ?
It looks like the JMS broker try to register to the JMX server before running the test.
Tried that, it wasn't the answer, but it helped me find it, thanks.
Now, if I have only one test it works. But the second test fails because it tried to create the broker again but the broker is still running from the first test.
You should possible stop the broker in the tearDown method, so its properly shutdown between tests.
I've got everything working. The most recent problem is with testNG. The attached patch modifies an instance of the standard spring archetype to use a test class. I've also now got it working the way I wanted with a webconsole archetype.
All the problems were detail ones. I do think it would be great to have sample tests in the sample archetypes.
Thanks to Willem for really helpful ideas that got me going in the right direction
Edited by: julianc on Dec 5, 2011 5:36 PM
jc.patch 6.7 KB