コード例 #1
0
ファイル: OpalFileSystemTest.java プロジェクト: obiba/opal
  @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();
    }
  }
コード例 #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();
  }
コード例 #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);
 }