Пример #1
0
    /**
     * Tests creating file in appropriate local directory.
     *
     * @throws Exception unexpected
     */
    @Test
    public void test04CanCreateFileInNewLocalDirectory() throws Exception {
      session.changeLocalDirectory(System.getProperty("user.dir"));
      testDir = new File(session.getLocalDirectory(), "goodSessionTestDir");
      testDir.mkdir();
      testDir.deleteOnExit();
      session.changeLocalDirectory(testDir.getPath());

      File testfile = new File(session.getLocalDirectory(), "goodSessionTest04");
      testfile.createNewFile();
      testfile.deleteOnExit();
      assertTrue(testfile.getAbsolutePath().contains(testDir.getAbsolutePath()));
      // Force deletion now so we can delete containing directory later.
      assertTrue(testfile.delete());
    }
Пример #2
0
 /** Tests changing local directory. */
 @Test
 public void test03CanChangeLocalDirectory() {
   assertTrue(session.changeLocalDirectory(folder.getRoot().getPath()));
 }