Ejemplo n.º 1
0
  @Before
  public void setUp() throws FileSystemException {

    fsLocal = new DefaultOpalFileSystem("res:opal-file-system");
    fsLocalRoot = fsLocal.getRoot();

    // MockFtpServer blocks the execution of this test under the unix environment, so this test
    // will be run on Windows until we find a solution...
    if (runningOsIsWindows()) {

      mockFtpServer = new FakeFtpServer();
      mockFtpServer.addUserAccount(new UserAccount("user", "password", "c:/"));

      FileSystem fileSystem = new WindowsFakeFileSystem();
      fileSystem.add(new DirectoryEntry("c:/temp"));
      fileSystem.add(new FileEntry("c:/temp/file1.txt"));
      fileSystem.add(new FileEntry("c:/temp/file2.txt", "this is the file content"));
      mockFtpServer.setFileSystem(fileSystem);

      mockFtpServer.start();

      fsFtp = new DefaultOpalFileSystem("ftp://*****:*****@localhost:21");
      fsFtpRoot = fsFtp.getRoot();
    }
  }
Ejemplo n.º 2
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();
  }
Ejemplo n.º 3
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);
 }