Re: Unit Testing Question

2014-01-27 Thread Castyn
I figured it out, was an sl4j version issue. Seems things are working now so I appreciate the help! -- View this message in context: http://camel.465427.n5.nabble.com/Unit-Testing-Question-tp5745966p5746502.html Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Unit Testing Question

2014-01-25 Thread Willem.Jiang
Can you double check the camel jars in your class path to see if there is another version of camel jar in your class path? BTW, can you tell us which ClassDef is not found? -- View this message in context: http://camel.465427.n5.nabble.com/Unit-Testing-Question-tp5745966p5746476.html Sent fro

Re: Unit Testing Question

2014-01-24 Thread Castyn
I changed my import of org.apache.camel.test.CamelTestSupport to org.apache.camel.test.junit4.CamelTestSupport, and now it generates a different error within surefire. Tests in error: SimpleTest>TestSupport.:55 » NoClassDefFound org/s... SimpleTest.com.ihg.atp.ess.processor.SimpleTest » NoCla

Re: Unit Testing Question

2014-01-24 Thread Castyn
Still have not been able to figure this out. I tried few simple purely JUnit tests and they worked fine and were executed by surefire with no issues, but for some reason once I extend to CamelTestSupport it says no tests were found no matter what kind of tests are there. Could this be a version i

Re: Unit Testing Question

2014-01-21 Thread Castyn
For the fixtures in the example, does that need to be embedded into a Routebuilder? I'm still trying to setup this simple example but unsure how the fixture here is actually invoked. Currently all of my routes are actually created in the spring DSL as well. Any elaboration on this would be helpf

Re: Unit Testing Question

2014-01-17 Thread kraythe .
There are a number of examples on the camel testing page. However I can provide perhaps some information. Mock endpoints are just recorders of information the previous poster used in example. Normally an endpoint doesn't keep track of what exchanges go through it but mock ones do. You can also mock

Re: Unit Testing Question

2014-01-17 Thread Henryk Konsek
> I don't really understand yet how mock endpoints work, I am seeking a simple > example to help get me over this. You can test your processor with Mock endpoint by using the latter to catch exchange processed by the former. // Fixtures from("direct:test").process(new testProc()).to("mock:test");

Re: Unit Testing Question

2014-01-16 Thread Castyn
I've been reading over all of the test documentation and Mock documentation. It seems that I should be able to just setup a mock endpoint for the URI of the processor and use the producer template to send the information to the endpoint and run the asserts on that endpoint. Is that a proper usage

Re: Unit Testing Question

2014-01-15 Thread Christoph Emmersberger
Hi in case you want to test the entire route, I’d recommend using a producer template. The ProducerTemplate can send an exchange via: template.send(“your://endoint/uri”, exchange); Best, Christoph On 15 Jan 2014, at 18:48, Castyn wrote: > So to go a bit further, assuming I setup the produce

Re: Unit Testing Question

2014-01-15 Thread Claus Ibsen
Since your bean with the setProcessStatus method requires an exchange, then you should not really use the producer template. Just create a new DefaultExchange and popular it with data, and call the method. Just like regular java code. On Wed, Jan 15, 2014 at 6:48 PM, Castyn wrote: > So to go

Re: Unit Testing Question

2014-01-15 Thread Castyn
So to go a bit further, assuming I setup the producer template to mimic and exchange to test this method, how then do I send that exchange to the method? Do I just instantiate the processor within the test case and use the template.send(Processor) method signature to do this? If so how then do I

Re: Unit Testing Question

2014-01-15 Thread Castyn
In most cases in my code I utilize processors to do exactly what you mention. This situation is sort of a special case where I wanted to house all of the route logic within a single class in the java DSL. Typically in this project I have setup to use camel-jdbc, camel-cxf, etc as their own endpoi

Re: Unit Testing Question

2014-01-15 Thread Henryk Konsek
Hi, > I am curious how it would be possible to setup the necessary aspects for a > unit test of this method? How do you setup an entire exchange in a unit > test, or is there capabilities built in somewhere I am unaware of? You can set up exchange fixtures with the appropriate ProducerTemplate m

Re: Unit Testing Question

2014-01-15 Thread Claus Ibsen
Hi There is a lot of information about testing at http://camel.apache.org/testing And also in the books published http://camel.apache.org/books On Tue, Jan 14, 2014 at 9:53 PM, Castyn wrote: > Greetings, I have a question around unit testing within Camel as I am fairly > new to it. I have a p