4243444546474849
assertNotNull(exchange); assertEquals("hello.txt", exchange.getIn().getHeader(Exchange.FILE_NAME, String.class)); assertEquals("Hello World", exchange.getIn().getBody(String.class)); consumer.stop(); } }
4748495051525354555657
assertNotNull("Should get the file", out); try { // give consumer time to try to delete the file Thread.sleep(1000); consumer.stop(); } catch (GenericFileOperationFailedException fofe) { // expected, ignore } }
102103104105106107108109110111112
// the result is the response from the FTP consumer (the downloaded file) // replace the outher exchange with the content from the downloaded file exchange.getIn().setBody(result.getIn().getBody()); // stop the consumer consumer.stop(); } }).to("mock:result"); // END SNIPPET: e2 } };
585960616263646566
Thread.sleep(1000); File file = new File("target/enrich/bye.txt").getAbsoluteFile(); assertTrue("File should exist " + file, file.exists()); consumer.stop(); } }
5859606162636465666768
processor.process(exchange); } } } finally { try { consumer.stop(); } catch (Exception e) { LOG.warn("Failed to stop PollingConsumer: " + e, e); } } }
363738394041424344
consumer.start(); Exchange exchange = consumer.receive(); log.info("Receive " + exchange); assertNotNull(exchange); assertNotNull(exchange.getIn().getBody()); consumer.stop(); } }
101102103104105106107108109110111
6970717273747576777879
565758596061626364
Thread.sleep(1000); File file = new File(FTP_ROOT_DIR + "polling/bye.txt").getAbsoluteFile(); assertTrue("File should exist " + file, file.exists()); consumer.stop(); } }