Пример #1
0
        public virtual void testStopStart()
        {
            hf = new HotFolder(theHF, null, new MyListener(true));
            FileInfo file = new FileInfo(theHF + Path.DirectorySeparatorChar.ToString() + "f1.txt");

            SupportClass.FileSupport.CreateNewFile(file);
            file.Refresh();
            Assert.IsTrue(file.Exists);
            StatusCounter.sleep(3000);
            file.Refresh();
            Assert.IsFalse(file.Exists, "First delete attempt.");
            hf.Stop();
            hf.Stop();
            SupportClass.FileSupport.CreateNewFile(file);
            file.Refresh();
            Assert.IsTrue(file.Exists);
            StatusCounter.sleep(3000);
            file.Refresh();
            Assert.IsTrue(file.Exists);
            hf.restart();
            hf.restart();
            hf.restart();
            StatusCounter.sleep(5000);
            file.Refresh();
            Assert.IsFalse(file.Exists, "Second delete attempt.");
        }
Пример #2
0
 public virtual void testRestartMany()
 {
     hf = new HotFolder(theHF, null, new MyListener(true));
     for (int i = 0; i < 10; i++)
     {
         // Java to C# Conversion - TODO: What is .NET Equivalent to activeCount()?
         //Assert.AreEqual(3, Thread.activeCount());
         hf.restart();
     }
     for (int i = 0; i < 3; i++)
     {
         Thread.Sleep(1);
         hf.Stop();
         // Java to C# Conversion - TODO: What is .NET Equivalent to activeCount()?
         //Assert.AreEqual(2, Thread.activeCount());
     }
 }
Пример #3
0
 ///
 ///     <summary> * stop this hot folder
 ///     * </summary>
 ///
 public virtual void stop()
 {
     hf.Stop();
 }
Пример #4
0
 public override void tearDown()
 {
     hf.Stop();
     base.tearDown();
 }