Пример #1
0
  @Before
  public void setup() {
    fakeFtpServer = new FakeFtpServer();
    fakeFtpServer.setServerControlPort(10021);
    fakeFtpServer.addUserAccount(new UserAccount("user", "pass", "/"));

    FileSystem fileSystem = new UnixFakeFileSystem();
    fileSystem.add(new DirectoryEntry("/"));

    fakeFtpServer.setFileSystem(fileSystem);

    fakeFtpServer.start();
  }
Пример #2
0
 // Setup a basic environment before running the tests
 @Before
 public void setUp() {
   fakeFtpServer = new FakeFtpServer();
   fakeFtpServer.setServerControlPort(0);
   fakeFtpServer.addUserAccount(new UserAccount("user", "password", "/target/test-classes"));
   FileSystem fileSystem = new UnixFakeFileSystem();
   FileEntry dmi1 = new FileEntry("/target/test-classes/DMI1.nc");
   dmi1.setLastModified(new Date());
   fileSystem.add(dmi1);
   FileEntry dmi2 = new FileEntry("/target/test-classes/DMI2.nc");
   dmi2.setLastModified(new GregorianCalendar(2011, 9, 30).getTime());
   fileSystem.add(dmi2);
   fakeFtpServer.setFileSystem(fileSystem);
 }