Hi:
I am new to camel. 

I am trying to use camel to FTP individual files and handle any exceptions.

In the below unit test code, when the FTP connection fails due to invalid
host, I want my unit test exception block to run and the unit test should
fail.

Currently, I see camel exceptions in the log but unit test passes.

    @Test
    public void testFTPRoute(){
        try{
                
                RouteBuilder rbuilder = new RouteBuilder() {
                        @Override
                        public void configure() throws Exception {
                        
from("file://c:/temp/backup/?fileName=some-file.csv&move=processed&moveFailed=failed")
                                
.to("ftp://someUser@InvalidHost/SomeFolder?password=*****";);
                        }
                };
                
                CamelContext context = new DefaultCamelContext();
                context.addRoutes(rbuilder);
                                
                context.start();
                Thread.sleep(10000);
                context.stop();

        }catch(Exception e){
                log.error("Error in testFTPRoute: ", e);
                Assert.fail();
        }
    }




--
View this message in context: 
http://camel.465427.n5.nabble.com/Using-camel-to-FTP-individual-file-and-handle-exceptions-tp5763790.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to