anchor.diff:  -include_lib("common_test/include/ct.hrl").
   
   %%--------------- DEFINES ------------------------------------
  --define(default_timeout, ?t:minutes(20)).
  +-define(default_timeout, test_server:minutes(20)).
   -define(match(ExpectedRes, Expr),
           fun() ->
                  AcTuAlReS = (catch (Expr)),
  
positive.code: -define(TEST_FILE_DATA,   "If this file exists after a completed test an error occurred.").   
  -define(TEST_FILE_DATA2,  "1234567890123").
  
  
  %%-----------------------------------------------------------------
  %%  aoo-file test
  %%-----------------------------------------------------------------
  app_test(doc) -> [];
  app_test(suite) -> [];
  app_test(_Config) ->
      ?line ok=?t:app_test(cosFileTransfer),
      ok.
  
  %%-----------------------------------------------------------------
  %%  FileIterator API tests 
  %%-----------------------------------------------------------------
  fileIterator_api(doc) -> ["CosFileTransfer FileIterator API tests.", ""];
  fileIterator_api(suite) -> [];
  fileIterator_api(Config) ->
      case ftp_host(Config) of
  	{skipped, SkippedReason} ->
  	    {skipped, SkippedReason};
  	Host ->
  	    
  	    ?line {ok, Node} = create_node("fileIterator_api", 4008, normal),
  	    ?line ?match(ok, remote_apply(Node, ?MODULE, install_data, 
  					  [tcp, {{'NATIVE', 
  						  'cosFileTransferNATIVE_file'}, Host, 
  						 "fileIterator_api"}])),
  	    
              %% Create a Virtual File System.
  %%    ?line VFS = ?match({_,_,_,_,_,_},
  %%		 cosFileTransferApp:create_VFS({'NATIVE', 
  %%						'cosFileTransferNATIVE_file'}, 
  %%					       [], Host, ?FTP_PORT)),
  	    ?line VFS = ?matchnopr({'IOP_IOR',"IDL:omg.org/CosFileTransfer/VirtualFileSystem:1.0",_}, 
  				   corba:string_to_object("corbaname::1.2@localhost:4008/NameService#fileIterator_api")),
  
              %% Start two File Transfer Sessions (Source and Target).
  	    ?line {FS, Dir} = ?matchnopr({{_,_,_},{_,_,_}},
  			'CosFileTransfer_VirtualFileSystem':login(VFS, 
  								  ?FTP_USER, 
  								  ?FTP_PASS, 
  								  ?FTP_ACC)),
  
              %% Do some basic test on one of the Directories attributes.
  	    ?line ?match([_H|_], 'CosFileTransfer_Directory':'_get_name'(Dir)),
  	    ?line ?match([_H|_], 'CosFileTransfer_Directory':'_get_complete_file_name'(Dir)),
  	    ?line ?match({'IOP_IOR',[],[]}, 'CosFileTransfer_Directory':'_get_parent'(Dir)),
  	    ?line ?matchnopr(FS, 'CosFileTransfer_Directory':'_get_associated_session'(Dir)),
  	    {ok,[],FileIter} = ?match({ok,[],_}, 'CosFileTransfer_Directory':list(Dir, 0)),
              %% Usually the working directory for the test is not empty so no need for
              %% creating files of our own?!
  
negative.code: %%-----------------------------------------------------------------
  %%  FileTransferSession API tests 
  %%-----------------------------------------------------------------
  fts_ftp_dir_api(Config) ->
      {ok, Node} = create_node("ftp_dir_api", 4009, normal),
      dir_helper(Config, 'FTP', ?TEST_DIR, Node, 4009, "ftp_dir_api").
  
  fts_native_dir_api(Config) ->
      {ok, Node} = create_node("native_dir_api", 4010, normal),
      {ok, Pwd} = file:get_cwd(),
      dir_helper(Config, {'NATIVE', 'cosFileTransferNATIVE_file'}, 
  	       filename:split(Pwd), Node, 4010, "native_dir_api").
  