Ejemplo n.º 1
0
        internal virtual void FixtureSetUp()
        {
            Logger.AddAppender(new FileAppender(logDir + "\\" + LogName));

            int[] ver = FTPClient.Version;
            log.Info("FTP version: " + ver[0] + "." + ver[1] + "." + ver[2]);
            log.Info("FTP build timestamp: " + FTPClient.BuildTimestamp);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Performs TCP connection and sets up reader/writer.
        /// Allows different control port to be used
        /// </summary>
        /// <param name="sock">
        ///  Socket instance
        /// </param>
        /// <param name="remoteHost">
        /// address of remote host
        /// </param>
        /// <param name="controlPort">
        /// port for control stream
        /// </param>
        /// <param name="timeout">
        /// the length of the timeout, in milliseconds
        /// </param>
        internal void Initialize(BaseSocket sock, IPAddress remoteHost, int controlPort, int timeout)
        {
            this.remoteHost  = remoteHost;
            this.controlPort = controlPort;
            this.timeout     = timeout;

            log = Logger.GetLogger(typeof(FTPControlSocket));

            // establish socket connection & set timeouts
            controlSock = sock;
            ConnectSocket(controlSock, remoteHost, controlPort);
            Timeout = timeout;

            InitStreams();
            ValidateConnection();
        }
Ejemplo n.º 3
0
        /// <summary>  Initialize test properties</summary>
        public AbstractTestCase()
        {
#pragma warning disable 618
            log = Logger.GetLogger("AbstractTestCase");

            Logger.CurrentLevel = Level.DEBUG;

            // initialise our test properties
            host     = ConfigurationSettings.AppSettings["ftptest.host"];
            user     = ConfigurationSettings.AppSettings["ftptest.user"];
            password = ConfigurationSettings.AppSettings["ftptest.password"];

            random   = new Random();
            lowPort  = random.Next(5000, 15000);
            highPort = lowPort + 100;

            // active or passive?
            string connectMode = ConfigurationSettings.AppSettings["ftptest.connectmode"];
            if (connectMode != null && connectMode.ToUpper().Equals("active".ToUpper()))
            {
                this.connectMode = FTPConnectMode.ACTIVE;
            }
            else
            {
                this.connectMode = FTPConnectMode.PASV;
            }

            // socket timeout
            string timeout = ConfigurationSettings.AppSettings["ftptest.timeout"];
            this.timeout = System.Int32.Parse(timeout);

            string strict = ConfigurationSettings.AppSettings["ftptest.strictreplies"];
            if (strict != null && strict.ToUpper().Equals("false".ToUpper()))
            {
                this.strictReplies = false;
            }
            else
            {
                this.strictReplies = true;
            }

            string wakeupStr = ConfigurationSettings.AppSettings["ftptest.wakeupinterval"];
            if (wakeupStr != null)
            {
                serverWakeupInterval = Int32.Parse(wakeupStr);
            }

            // various test files and dirs
            testdir        = ConfigurationSettings.AppSettings["ftptest.testdir"];
            localDataDir   = ConfigurationSettings.AppSettings["ftptest.datadir.local"];
            localRecopsDir = ConfigurationSettings.AppSettings["ftptest.datadir.local.recops"];
            if (localDataDir != null && !localDataDir.EndsWith("\\"))
            {
                localDataDir += "\\";
            }
            localRecopsDir   = localDataDir + localRecopsDir;
            localTextFile    = ConfigurationSettings.AppSettings["ftptest.file.local.text"];
            remoteTextFile   = ConfigurationSettings.AppSettings["ftptest.file.remote.text"];
            localBinaryFile  = ConfigurationSettings.AppSettings["ftptest.file.local.binary"];
            remoteBinaryFile = ConfigurationSettings.AppSettings["ftptest.file.remote.binary"];
            localEmptyFile   = ConfigurationSettings.AppSettings["ftptest.file.local.empty"];
            remoteEmptyFile  = ConfigurationSettings.AppSettings["ftptest.file.remote.empty"];
            localBigFile     = ConfigurationSettings.AppSettings["ftptest.file.local.big"];
            remoteEmptyDir   = ConfigurationSettings.AppSettings["ftptest.dir.remote.empty"];
            logDir           = ConfigurationSettings.AppSettings["ftptest.logdir"];
            string bulkCountStr = ConfigurationSettings.AppSettings["ftptest.bulkcount"];
            if (bulkCountStr != null)
            {
                bulkCount = Int32.Parse(bulkCountStr);
            }

            //FixtureSetUp();
#pragma warning restore 618
        }
Ejemplo n.º 4
0
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="sock">   the server socket to use
 /// </param>
 internal FTPActiveDataSocket(BaseSocket sock)
 {
     this.sock = sock;
     log       = Logger.GetLogger("FTPActiveDataSocket");
 }
Ejemplo n.º 5
0
 /// <summary> Default constructor</summary>
 public WindowsFileParser()
 {
     log = Logger.GetLogger(typeof(WindowsFileParser));
 }
Ejemplo n.º 6
0
        /// <summary>   
        /// Performs TCP connection and sets up reader/writer. 
        /// Allows different control port to be used
        /// </summary>
        /// <param name="sock">
        ///  Socket instance
        /// </param>
        /// <param name="remoteHost">     
        /// address of remote host
        /// </param>
        /// <param name="controlPort">     
        /// port for control stream
        /// </param>
        /// <param name="timeout">    
        /// the length of the timeout, in milliseconds      
        /// </param>
        internal void Initialize(BaseSocket sock, IPAddress remoteHost, int controlPort, int timeout)
        {
            this.remoteHost = remoteHost;
            this.controlPort = controlPort;
            this.timeout = timeout;

            log = Logger.GetLogger(typeof(FTPControlSocket));

            // establish socket connection & set timeouts
            controlSock = sock;
            ConnectSocket(controlSock, remoteHost, controlPort);
            Timeout = timeout;

            InitStreams();
            ValidateConnection();
        }
Ejemplo n.º 7
0
		/// <summary>  
		/// Constructor
		/// </summary>
		/// <param name="sock">   the server socket to use
		/// </param>
		internal FTPActiveDataSocket(BaseSocket sock)
		{
			this.sock = sock;
            log = Logger.GetLogger("FTPActiveDataSocket");
		}
Ejemplo n.º 8
0
 /// <summary> Default constructor</summary>
 public UnixFileParser()
 {
     log = Logger.GetLogger(typeof(UnixFileParser));
 }
Ejemplo n.º 9
0
        /// <summary>  Initialize test properties</summary>
        public FTPTestCase()
        {
            log = Logger.GetLogger(typeof(FTPTestCase));

            Logger.CurrentLevel = Level.ALL;

            // initialise our test properties
            host = ConfigurationSettings.AppSettings["ftptest.host"];
            user = ConfigurationSettings.AppSettings["ftptest.user"];
            password = ConfigurationSettings.AppSettings["ftptest.password"];

            // active or passive?
            string connectMode = ConfigurationSettings.AppSettings["ftptest.connectmode"];
            if (connectMode != null && connectMode.ToUpper().Equals("active".ToUpper()))
                this.connectMode = FTPConnectMode.ACTIVE;
            else
                this.connectMode = FTPConnectMode.PASV;

            // socket timeout
            string timeout = ConfigurationSettings.AppSettings["ftptest.timeout"];
            this.timeout = System.Int32.Parse(timeout);

            string strict = ConfigurationSettings.AppSettings["ftptest.strictreplies"];
            if (strict != null && strict.ToUpper().Equals("false".ToUpper()))
                this.strictReplies = false;
            else
                this.strictReplies = true;

            // various test files and dirs
            testdir = ConfigurationSettings.AppSettings["ftptest.testdir"];
            localTextFile = ConfigurationSettings.AppSettings["ftptest.file.local.text"];
            remoteTextFile = ConfigurationSettings.AppSettings["ftptest.file.remote.text"];
            localBinaryFile = ConfigurationSettings.AppSettings["ftptest.file.local.binary"];
            remoteBinaryFile = ConfigurationSettings.AppSettings["ftptest.file.remote.binary"];
            localEmptyFile = ConfigurationSettings.AppSettings["ftptest.file.local.empty"];
            remoteEmptyFile = ConfigurationSettings.AppSettings["ftptest.file.remote.empty"];
            remoteEmptyDir = ConfigurationSettings.AppSettings["ftptest.dir.remote.empty"];
        }
Ejemplo n.º 10
0
 /// <summary>  
 /// Instance initializer. Sets formatter to GMT.
 /// </summary>
 private void InitBlock()
 {
     log = Logger.GetLogger(typeof(FTPClient));
     transferType = FTPTransferType.ASCII;
     connectMode = FTPConnectMode.PASV;
     controlPort = FTPControlSocket.CONTROL_PORT;
 }
Ejemplo n.º 11
0
 internal virtual void FixtureTearDown()
 {
     Logger.Shutdown();
     ftp = null;
 }
Ejemplo n.º 12
0
 /// <summary> Default constructor</summary>
 public WindowsFileParser()
 {
     log = Logger.GetLogger(typeof(WindowsFileParser));
 }
Ejemplo n.º 13
0
 /// <summary> Default constructor</summary>
 public UnixFileParser()
 {
     log = Logger.GetLogger(typeof(UnixFileParser));
 }
Ejemplo n.º 14
0
 private void InitBlock()
 {
     log = Logger.GetLogger(typeof(FTPFileFactory));
 }
Ejemplo n.º 15
0
 private void  InitBlock()
 {
     log = Logger.GetLogger(typeof(FTPFileFactory));
 }