public void CanBeDisposedMoreThanOnce()
        {
            IDeployLocation location = new FileSystemDeployLocation(dispatcher,
                                                                    DefaultApplicationWatcherFactory.Instance, deployPath, true);

            location.Dispose();
            location.Dispose();
        }
 public void TearDown_()
 {
     log.Debug("disposing location ");
     if (location != null)
     {
         location.Dispose();
     }
     try
     {
         TestUtils.SafeDeleteDirectory(Path.GetFullPath(deployPath));
     }
     catch (Exception e)
     {
         log.Error("deploy folder not deleted", e);
     }
     try
     {
         TestUtils.SafeDeleteDirectory(Path.GetFullPath(deployPath));
     }
     catch (Exception e)
     {
         log.Error("test folder not deleted", e);
     }
     Assert.IsFalse(Directory.Exists(Path.GetFullPath(deployPath)), "the root of the deploy directory still exist");
 }
        public void CanBeStartedExplicitlyStartedButIsImplicitlyStoppedWhenDisposed()
        {
            FileSystemDeployLocation location = new FileSystemDeployLocation(deployPath);

            location.StartWatching();
            location.Dispose();
            location.StartWatching();
        }
        public void LockFileIsDeletedOnDisposeOrStop()
        {
            FileSystemDeployLocation location =
                new FileSystemDeployLocation(dispatcher, deployPath);

            location.StartWatching();
            location.Dispose();
            Assert.IsFalse(File.Exists(location.LockFileName));
        }
예제 #5
0
 public void TearDown()
 {
     if (defaultDeployer.Ex != null)
     {
         Console.Out.WriteLine("defaultDeployer exception = {0}", defaultDeployer.Ex);
     }
     deployManager.Stop();
     location.Dispose();
     TestUtils.SafeDeleteDirectory(deployPath, 25);
 }
 public void TheAssociatedWatcherIsStoppedAndDisposedOnDispose()
 {
     factoryMock.ExpectAndReturn("CreateApplicationWatcherMonitor", watcher);
     watcherMock.Expect("StartWatching");
     watcherMock.Expect("StopWatching");
     watcherMock.Expect("Dispose");
     AddApplication();
     location = new FileSystemDeployLocation(new ForwardingDeployEventDispatcher(), factory, deployPath, true);
     triggeredLatch.Acquire();
     location.Dispose();
 }
        public void DisposeDispatcherOnDispose()
        {
            DynamicMock            mock       = new DynamicMock(typeof(IDeployEventDispatcher));
            IDeployEventDispatcher dispatcher = (IDeployEventDispatcher)mock.Object;

            mock.Expect("Dispose");
            IDeployLocation location = new FileSystemDeployLocation(dispatcher, deployPath);

            location.Dispose();
            mock.Verify();
        }
 public void CanBeStartedExplicitlyStartedButIsImplicitlyStoppedWhenDisposed ()
 {
     FileSystemDeployLocation location = new FileSystemDeployLocation(deployPath);
     location.StartWatching();
     location.Dispose();
     location.StartWatching();
 }
 public void CanBeDisposedMoreThanOnce ()
 {
     IDeployLocation location = new FileSystemDeployLocation(dispatcher, 
         DefaultApplicationWatcherFactory.Instance, deployPath, true);
     location.Dispose();
     location.Dispose();
 }
 public void LockFileIsDeletedOnDisposeOrStop ()
 {
     FileSystemDeployLocation location = 
         new FileSystemDeployLocation (dispatcher, deployPath);
     location.StartWatching ();
     location.Dispose();
     Assert.IsFalse (File.Exists (location.LockFileName));
 }
 public void TheAssociatedWatcherIsStoppedAndDisposedOnDispose ()
 {
     factoryMock.ExpectAndReturn("CreateApplicationWatcherMonitor", watcher);
     watcherMock.Expect("StartWatching");
     watcherMock.Expect("StopWatching");
     watcherMock.Expect("Dispose");
     AddApplication();
     location = new FileSystemDeployLocation (new ForwardingDeployEventDispatcher(), factory, deployPath, true);
     triggeredLatch.Acquire();
     location.Dispose();
 }        
 public void DisposeDispatcherOnDispose ()
 {
     DynamicMock mock = new DynamicMock (typeof (IDeployEventDispatcher));
     IDeployEventDispatcher dispatcher = (IDeployEventDispatcher) mock.Object;
     mock.Expect ("Dispose");
     IDeployLocation location = new FileSystemDeployLocation (dispatcher, deployPath);
     location.Dispose ();
     mock.Verify ();
 }