159160161162163164165166167168169
consumer.start(); Exchange bar = consumer.receiveNoWait(); assertNull("Should NOT be a message on queue", bar); consumer.stop(); template.sendBody("activemq:queue:foo", "Hello World"); assertMockEndpointsSatisfied(); }
6970717273747576777879
processor.process(exchange); } } } finally { try { consumer.stop(); } catch (Exception e) { LOG.warn("Failed to stop PollingConsumer: " + e, e); } } }
6465666768697071727374
3738394041424344
assertNotNull(exchange); assertEquals("hello.txt", exchange.getIn().getHeader(Exchange.FILE_NAME, String.class)); assertEquals("Hello World", exchange.getIn().getBody(String.class)); consumer.stop(); } }
535455565758596061
Thread.sleep(1000); File file = new File("target/enrich/bye.txt").getAbsoluteFile(); assertTrue("File should exist " + file, file.exists()); consumer.stop(); } }
5859606162636465666768
606162636465666768
// and no exchange on consumer as exchange = consumer.receiveNoWait(); assertNull(exchange); consumer.stop(); } }
575859606162636465
565758596061626364
Thread.sleep(1000); File file = new File(FTP_ROOT_DIR + "/polling/bye.txt").getAbsoluteFile(); assertTrue("File should exist " + file, file.exists()); consumer.stop(); } }