/**
  * Tests restoring session after disconnect.
  *
  * @throws Exception
  */
 @Test
 public void test07CanRestoreSessionAfterDisconnect() throws Exception {
   session.disconnect();
   session.restore();
   assertTrue(session.isConnected());
   assertTrue(session.printWorkingDirectory().contains("for_testing"));
 }
 /** Test attempt to change remote directory to a nonexistent directory. */
 @Test
 public void test05ChangeRemoteDirWithBadDirFails() throws Exception {
   session.login(USER, PASSWORD);
   String missingDir = "eleventy_squash";
   assertTrue(!session.changeWorkingDirectory(missingDir));
   assertTrue(!session.printWorkingDirectory().contains(missingDir));
 }
 /**
  * Tests changing remote directory.
  *
  * @throws Exception
  */
 @Test
 public void test06CanChangeRemoteDirectory() throws Exception {
   assertTrue(session.changeWorkingDirectory("for_testing"));
   assertTrue(session.printWorkingDirectory().contains("for_testing"));
 }