@Test public void testConsume_IgnoresWipFiles() throws Exception { int count = 1; EmbeddedFtpServer helper = new EmbeddedFtpServer(); MockMessageListener listener = new MockMessageListener(100); FtpConsumer ftpConsumer = createForTests(listener, "testConsume_IgnoresWipFiles"); FileSystem filesystem = helper.createFilesystem_DirsOnly(); for (int i = 0; i < count; i++) { filesystem.add(new FileEntry(DEFAULT_WORK_DIR_CANONICAL + SLASH + DEFAULT_FILENAME + i + ".txt", PAYLOAD)); } filesystem.add(new FileEntry(DEFAULT_WORK_DIR_CANONICAL + SLASH + "shouldBeIgnored.txt" + ftpConsumer.wipSuffix(), PAYLOAD)); FakeFtpServer server = helper.createAndStart(filesystem); StandaloneConsumer sc = null; try { FtpConnection consumeConnection = create(server); sc = new StandaloneConsumer(consumeConnection, ftpConsumer); start(sc); waitForMessages(listener, count); helper.assertMessages(listener.getMessages(), count); Thread.sleep(2000); assertTrue(filesystem.listFiles(DEFAULT_WORK_DIR_CANONICAL).size() > 0); } catch (Exception e) { throw e; } finally { stop(sc); server.stop(); } }
String wipSuffix() { return getWipSuffix() != null ? getWipSuffix() : DEFAULT_WIP_SUFFIX; }
FtpConsumer extends FtpConsumerImpl { String wipSuffix() { return getWipSuffix() != null ? getWipSuffix() : DEFAULT_WIP_SUFFIX; } }
FtpConsumer extends FtpConsumerImpl { String wipSuffix() { return getWipSuffix() != null ? getWipSuffix() : DEFAULT_WIP_SUFFIX; } FtpConsumer(); }
FtpConsumer extends FtpConsumerImpl { String wipSuffix() { return getWipSuffix() != null ? getWipSuffix() : DEFAULT_WIP_SUFFIX; } FtpConsumer(); @Override void init(); String getProcDirectory(); String getWorkDirectory(); void setProcDirectory(String s); void setWorkDirectory(String s); String getWipSuffix(); void setWipSuffix(String s); }
FtpConsumer extends FtpConsumerImpl { String wipSuffix() { return getWipSuffix() != null ? getWipSuffix() : DEFAULT_WIP_SUFFIX; } FtpConsumer(); @Override void init(); String getProcDirectory(); String getWorkDirectory(); void setProcDirectory(String s); void setWorkDirectory(String s); String getWipSuffix(); void setWipSuffix(String s);  }