You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by ankelee <an...@gmail.com> on 2010/06/10 10:50:12 UTC

Replace "from" endpoint with mock in test?

Hi

I'm setting up a test for a route that starts at an FTP-endpoint. I would
like to be able to test without setting up an FTP-server.

In Camel in Action there is shown a trick where you can replace the
jms-component with a seda-component and then consume from that endpoint. Is
there any tricks you could do similarly with the FTP-endpoint. I thought
about replacing it with a file endpoint but there's obviously unknown
parameters on there so that wouldn't work.

Is it possible to completely substitute a "from"-endpoint with another in
test/runtime?
-- 
View this message in context: http://old.nabble.com/Replace-%22from%22-endpoint-with-mock-in-test--tp28840433p28840433.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AW: Replace "from" endpoint with mock in test?

Posted by Willem Jiang <wi...@gmail.com>.
Yes, you just need to replace the from endpoint uri with a property, 
then you switch the ftp endpoint with file endpoint easily.

Replacing the jms-component with a seda-component is not a good example, 
as jms has some unique operations which seda-component will not take, 
and it will cause some endpoint URI resolver exception.

Willem

Max Ullinger wrote:
> Hi
> 
> Well, you could use property placeholders with different property files for test and runtime.
> You could then define the endpoints externally in two files and use the ftp component for runtime and the file component for tests.
> 
> Cheers,
> Max
> 
> -----Ursprüngliche Nachricht-----
> Von: ankelee [mailto:andreasasmuss@gmail.com] 
> Gesendet: Donnerstag, 10. Juni 2010 10:50
> An: users@camel.apache.org
> Betreff: Replace "from" endpoint with mock in test?
> 
> 
> Hi
> 
> I'm setting up a test for a route that starts at an FTP-endpoint. I would
> like to be able to test without setting up an FTP-server.
> 
> In Camel in Action there is shown a trick where you can replace the
> jms-component with a seda-component and then consume from that endpoint. Is
> there any tricks you could do similarly with the FTP-endpoint. I thought
> about replacing it with a file endpoint but there's obviously unknown
> parameters on there so that wouldn't work.
> 
> Is it possible to completely substitute a "from"-endpoint with another in
> test/runtime?


AW: Replace "from" endpoint with mock in test?

Posted by Max Ullinger <Ma...@ptv.de>.
Hi

Well, you could use property placeholders with different property files for test and runtime.
You could then define the endpoints externally in two files and use the ftp component for runtime and the file component for tests.

Cheers,
Max

-----Ursprüngliche Nachricht-----
Von: ankelee [mailto:andreasasmuss@gmail.com] 
Gesendet: Donnerstag, 10. Juni 2010 10:50
An: users@camel.apache.org
Betreff: Replace "from" endpoint with mock in test?


Hi

I'm setting up a test for a route that starts at an FTP-endpoint. I would
like to be able to test without setting up an FTP-server.

In Camel in Action there is shown a trick where you can replace the
jms-component with a seda-component and then consume from that endpoint. Is
there any tricks you could do similarly with the FTP-endpoint. I thought
about replacing it with a file endpoint but there's obviously unknown
parameters on there so that wouldn't work.

Is it possible to completely substitute a "from"-endpoint with another in
test/runtime?
-- 
View this message in context: http://old.nabble.com/Replace-%22from%22-endpoint-with-mock-in-test--tp28840433p28840433.html
Sent from the Camel - Users mailing list archive at Nabble.com.