public void testBasicConsume_WithTrailingSlash() throws Exception { if (areTestsEnabled()) { MockMessageListener listener = new MockMessageListener(); RelaxedFtpConsumer ftpConsumer = new RelaxedFtpConsumer(); String destination = getDestinationString() + "/"; ConfiguredConsumeDestination ccd = new ConfiguredConsumeDestination(destination); ccd.setConfiguredThreadName("testBasicConsume_WithTrailingSlash"); ftpConsumer.setDestination(ccd); ftpConsumer.registerAdaptrisMessageListener(listener); ftpConsumer.setOlderThan(DEFAULT_QUIET_PERIOD); ftpConsumer.setPoller(new QuartzCronPoller("*/1 * * * * ?")); StandaloneConsumer sc = new StandaloneConsumer(createConnection(), ftpConsumer); start(sc); int count = 1; try { RelaxedFtpProducer producer = createFtpProducer(); producer.setDestination(new ConfiguredProduceDestination(destination)); produce(new StandaloneProducer(createConnection(), producer), count); waitForMessages(listener, count); assertMessages(listener.getMessages(), count); } catch (Exception e) { log.error(e.getMessage(), e); throw e; } finally { stop(sc); } } }
protected RelaxedFtpProducer createFtpProducer() throws Exception { RelaxedFtpProducer p = new RelaxedFtpProducer(); ConfiguredProduceDestination d = new ConfiguredProduceDestination(getDestinationString()); p.setDestination(d); return p; }