Activiti-camel defect?

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-22-2011 04:31 PM
Hi,
I am using the activiti-camel integration (after reading the latest installment of "Activiti in Action"). Nice jobs all around! Kudos!
My problem comes with my unit test. My routes look like:
Is there a reason for addConsumer not being as follows?
Thanks for reading this to the end!
Nick.
I am using the activiti-camel integration (after reading the latest installment of "Activiti in Action"). Nice jobs all around! Kudos!
My problem comes with my unit test. My routes look like:
from("activiti:myProcess:servicetask1") .log(LoggingLevel.INFO, "Received message on service task") .to("jms:queue:myQueue"); from("direct:start") .to("activiti:myProcess");
Which I want to unit test using a MockEndpoint. I checked out http://camel.apache.org/mock.html, especially the section on "Mocking Existing Endpoints" and so I coded my unit test as: @Autowired private CamelContext camelContext; @Produce(uri = "direct:start", context = "camelProcess") protected ProducerTemplate template; @Test public void testMyProcessViaCamel() throws Exception { // Advise all the endpoints for (final RouteDefinition route : this.camelContext.getRouteDefinitions()) { route.adviceWith(this.camelContext, new AdviceWithRouteBuilder() { @Override public void configure() throws Exception { // mock all endpoints this.mockEndpoints(); } }); }
But this fails because I get a RuntimeException from the ActivitiEndpoint class: void addConsumer(ActivitiConsumer consumer) { if (activitiConsumer != null) { throw new RuntimeException("Activit consumer already defined for " + getEndpointUri() + "!"); } activitiConsumer = consumer; }
I was wondering if the ActivitiEndpoint should even care about adding a consumer when one has already been added? In this case, Camel has it's reasons for replacing the existing consumer.Is there a reason for addConsumer not being as follows?
void addConsumer(ActivitiConsumer consumer) { activitiConsumer = consumer; }
Thanks for reading this to the end!
Nick.
Labels:
- Labels:
-
Archive
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2011 07:20 AM
Hi,
Hmm good question. Can you share your test project so I can try to reproduce this?
Best regards,
Hmm good question. Can you share your test project so I can try to reproduce this?
Best regards,
