Exemplo n.º 1
0
        public void Bootstrap(string watchToken)
        {
            _watchToken = watchToken;
            BootStrapper.Configure(new LocalAppDataConfigurationLocator("AutoTest.config.template.VS"));
            BootStrapper.Container
                .Register(Component.For<IMessageProxy>()
                                    .Forward<IRunFeedbackView>()
                                    .Forward<IInformationFeedbackView>()
                                    .Forward<IConsumerOf<AbortMessage>>()
                                    .ImplementedBy<MessageProxy>().LifeStyle.Singleton);

            BootStrapper.Services
                .Locate<IRunResultCache>().EnabledDeltas();
            BootStrapper.InitializeCache(_watchToken);
            BootStrapper.Services
                .Locate<IMessageProxy>()
                .SetMessageForwarder(new FeedbackListener(_window));

            _configuredCustomOutput = BootStrapper.Services.Locate<IConfiguration>().CustomOutputPath;
            _watcher = BootStrapper.Services.Locate<IDirectoryWatcher>();
            _watcher.Watch(_watchToken);
            _window.DebugTest += new EventHandler<UI.DebugTestArgs>(_window_DebugTest);
            setCustomOutputPath();
            _window.Clear();
        }
Exemplo n.º 2
0
 public void Start(string directory)
 {
     _watcher.Watch(directory);
     _configuration.ValidateSettings();
     System.Console.ReadLine();
     Stop();
 }
Exemplo n.º 3
0
        public void Bootstrap(string watchToken)
        {
            _watchToken = watchToken;
            BootStrapper.Configure(new LocalAppDataConfigurationLocator("AutoTest.config.template.VS"));
            BootStrapper.Container
            .Register(Component.For <IMessageProxy>()
                      .Forward <IRunFeedbackView>()
                      .Forward <IInformationFeedbackView>()
                      .Forward <IConsumerOf <AbortMessage> >()
                      .ImplementedBy <MessageProxy>().LifeStyle.Singleton);

            BootStrapper.Services
            .Locate <IRunResultCache>().EnabledDeltas();
            BootStrapper.InitializeCache(_watchToken);
            BootStrapper.Services
            .Locate <IMessageProxy>()
            .SetMessageForwarder(new FeedbackListener(_window));

            _configuredCustomOutput = BootStrapper.Services.Locate <IConfiguration>().CustomOutputPath;
            _watcher = BootStrapper.Services.Locate <IDirectoryWatcher>();
            _watcher.Watch(_watchToken);
            _window.DebugTest += new EventHandler <UI.DebugTestArgs>(_window_DebugTest);
            _window.SetMessageBus(BootStrapper.Services.Locate <IMessageBus>());
            setCustomOutputPath();
            _window.Clear();
        }
Exemplo n.º 4
0
 public FeedbackView(Action<RunMessages> onMessage, Action<IRunResultCache> onCacheUpdate, DTE2 application)
 {
     _onMessage = onMessage;
     _onCacheUpdate = onCacheUpdate;
     _application = application;
     _presenter = BootStrapper.Services.Locate<IRunFeedbackPresenter>();
     _presenter.View = this;
     _resultsCache = BootStrapper.Services.Locate<IRunResultCache>();
     var infoPresenter = BootStrapper.Services.Locate<IInformationFeedbackPresenter>();
     _infoWindow = new InformationWindow(infoPresenter);
     _itemInfoWindow = new FeedbackItemWindow();
     _itemInfoWindow.LinkClicked += new EventHandler<StringArgs>(_itemInfoWindow_LinkClicked);
     BootStrapper.Services.Locate<IConfiguration>().ValidateSettings();
     _watcher = BootStrapper.Services.Locate<IDirectoryWatcher>();
     if (Connect.WatchFolder != null)
         _watcher.Watch(Connect.WatchFolder);
 }
Exemplo n.º 5
0
        public FeedbackView(Action <RunMessages> onMessage, Action <IRunResultCache> onCacheUpdate, DTE2 application)
        {
            _onMessage      = onMessage;
            _onCacheUpdate  = onCacheUpdate;
            _application    = application;
            _presenter      = BootStrapper.Services.Locate <IRunFeedbackPresenter>();
            _presenter.View = this;
            _resultsCache   = BootStrapper.Services.Locate <IRunResultCache>();
            var infoPresenter = BootStrapper.Services.Locate <IInformationFeedbackPresenter>();

            _infoWindow                  = new InformationWindow(infoPresenter);
            _itemInfoWindow              = new FeedbackItemWindow();
            _itemInfoWindow.LinkClicked += new EventHandler <StringArgs>(_itemInfoWindow_LinkClicked);
            BootStrapper.Services.Locate <IConfiguration>().ValidateSettings();
            _watcher = BootStrapper.Services.Locate <IDirectoryWatcher>();
            if (Connect.WatchFolder != null)
            {
                _watcher.Watch(Connect.WatchFolder);
            }
        }
Exemplo n.º 6
0
        public void Start()
        {
            lock (_padlock)
            {
                Logger.WriteDebug("Starting autotest.net engine");
                BootStrapper.SetBuildConfiguration(
                    new BuildConfiguration((original, @new) => {
                        var detector = new PublicContractChangeDetector();
                        var changes = detector.GetAllPublicContractChangesBetween(original, @new).ToArray();
                        var optimisticBuildPossible = changes.Length == 0;
                        if (!optimisticBuildPossible)
                        {
                            Debug.WriteDebug("Optimistic build changes");
                            foreach (var change in changes)
                                Debug.WriteDebug("\t" + change.ItemChanged);
                        }
                        return optimisticBuildPossible;
                    }));
                BootStrapper.Configure(_writeLocator);
                Logger.WriteDebug("Setting up log writer");
                Logger.SetWriter(BootStrapper.Services.Locate<IWriteDebugInfo>());
                BootStrapper.Container.Register(Component.For<IMessageProxy>()
                                                                .Forward<IConsumerOf<AssembliesMinimizedMessage>>()
                                                                .Forward<IConsumerOf<AbortMessage>>()
                                                                .ImplementedBy<AutoTestMessageProxy>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessTestruns>().ImplementedBy<MinimizingPreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().ImplementedBy<MinimizingBuildPreProcessor>());
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().Forward<IPreProcessTestruns>().ImplementedBy<OnDemanTestrunPreprocessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IPreProcessBuildruns>().ImplementedBy<RealtimeChangePreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For<IConsumerOf<FileChangeMessage>>().ImplementedBy<RecursiveRunCauseConsumer>().Named("RecursiveRunConsumer"));
                BootStrapper.Container.Register(Component.For<ICustomIgnoreProvider>().ImplementedBy<IgnoreProvider>());
                Logger.WriteDebug("Setting up message proxy");
                _proxy = BootStrapper.Services.Locate<IMessageProxy>();
                _proxy.SetMessageForwarder(_server);
                _proxy.RunStarted += _proxy_RunStarted;
                _proxy.RunFinished += _proxy_RunFinished;
                _configuration = BootStrapper.Services.Locate<IConfiguration>();
                if (_configuration.DebuggingEnabled)
                    Logger.EnableWriter();
                Logger.WriteDebug("Checking license");
                if (licenseIsInvalid())
                    return;

                _realtimeChangeTracker = new ChangeTracker(getRealtimeRunPreprocessor(), _configuration, BootStrapper.Services.Locate<IMessageBus>(), BootStrapper.Services.Locate<IGenerateBuildList>());
                Logger.WriteDebug("Setting up cache");
                var runCache = BootStrapper.Services.Locate<IRunResultCache>();
                runCache.EnabledDeltas();
                BootStrapper.InitializeCache(_watchPath);
                _watcher = BootStrapper.Services.Locate<IDirectoryWatcher>();
                Logger.WriteDebug("Looking for config in "+_localConfigLocation);
                _watcher.LocalConfigurationIsLocatedAt(_localConfigLocation);
                _watcher.Watch(_watchPath);
                _configuration.ValidateSettings();
                _configuredCustomOutput = _configuration.CustomOutputPath;
                var disableAll = _configuration.AllSettings("mm-AllDisabled").ToLower().Equals("true");
                StartedPaused = _configuration.StartPaused || disableAll;
                _isPaused = StartedPaused;
                setCustomOutputPath();
                var minimizer = getMinimizer();
                minimizer.ProfilerCompletedUpdate += minimizer_ProfilerCompletedUpdate;
                minimizer.ProfilerInitialized += minimizer_ProfilerInitialized;
                minimizer.MinimizerInitialized += minimizer_MinimizerInitialized;
                minimizer.ProfilingStarted += (sender, e) => _server.Send(new ProfiledTestRunStarted());
                minimizer.ProfilerLoadError += profiler_profilercorrupted;
                minimizer.SetManualUpdateProvider(() => _isPaused);
                initializeAllForPreProcessor(minimizer);
                if (disableAll)
                    Pause();
                IsRunning = true;
            }
        }
Exemplo n.º 7
0
        public void Start()
        {
            lock (_padlock)
            {
                Logger.WriteDebug("Starting autotest.net engine");
                BootStrapper.SetBuildConfiguration(
                    new BuildConfiguration((original, @new) => {
                    var detector = new PublicContractChangeDetector();
                    var changes  = detector.GetAllPublicContractChangesBetween(original, @new).ToArray();
                    var optimisticBuildPossible = changes.Length == 0;
                    if (!optimisticBuildPossible)
                    {
                        Debug.WriteDebug("Optimistic build changes");
                        foreach (var change in changes)
                        {
                            Debug.WriteDebug("\t" + change.ItemChanged);
                        }
                    }
                    return(optimisticBuildPossible);
                }));
                BootStrapper.Configure(_writeLocator);
                Logger.WriteDebug("Setting up log writer");
                Logger.SetWriter(BootStrapper.Services.Locate <IWriteDebugInfo>());
                BootStrapper.Container.Register(Component.For <IMessageProxy>()
                                                .Forward <IConsumerOf <AssembliesMinimizedMessage> >()
                                                .Forward <IConsumerOf <AbortMessage> >()
                                                .ImplementedBy <AutoTestMessageProxy>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessTestruns>().ImplementedBy <MinimizingPreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().ImplementedBy <MinimizingBuildPreProcessor>());
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().Forward <IPreProcessTestruns>().ImplementedBy <OnDemanTestrunPreprocessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IPreProcessBuildruns>().ImplementedBy <RealtimeChangePreProcessor>().LifeStyle.Singleton);
                BootStrapper.Container.Register(Component.For <IConsumerOf <FileChangeMessage> >().ImplementedBy <RecursiveRunCauseConsumer>().Named("RecursiveRunConsumer"));
                BootStrapper.Container.Register(Component.For <ICustomIgnoreProvider>().ImplementedBy <IgnoreProvider>());
                Logger.WriteDebug("Setting up message proxy");
                _proxy = BootStrapper.Services.Locate <IMessageProxy>();
                _proxy.SetMessageForwarder(_server);
                _proxy.RunStarted  += _proxy_RunStarted;
                _proxy.RunFinished += _proxy_RunFinished;
                _configuration      = BootStrapper.Services.Locate <IConfiguration>();
                if (_configuration.DebuggingEnabled)
                {
                    Logger.EnableWriter();
                }
                Logger.WriteDebug("Checking license");
                if (licenseIsInvalid())
                {
                    return;
                }

                _realtimeChangeTracker = new ChangeTracker(getRealtimeRunPreprocessor(), _configuration, BootStrapper.Services.Locate <IMessageBus>(), BootStrapper.Services.Locate <IGenerateBuildList>());
                Logger.WriteDebug("Setting up cache");
                var runCache = BootStrapper.Services.Locate <IRunResultCache>();
                runCache.EnabledDeltas();
                BootStrapper.InitializeCache(_watchPath);
                _watcher = BootStrapper.Services.Locate <IDirectoryWatcher>();
                _watcher.Watch(_watchPath);
                _configuration.ValidateSettings();
                _configuredCustomOutput = _configuration.CustomOutputPath;
                var disableAll = _configuration.AllSettings("mm-AllDisabled").ToLower().Equals("true");
                StartedPaused = _configuration.StartPaused || disableAll;
                _isPaused     = StartedPaused;
                setCustomOutputPath();
                var minimizer = getMinimizer();
                minimizer.ProfilerCompletedUpdate += minimizer_ProfilerCompletedUpdate;
                minimizer.ProfilerInitialized     += minimizer_ProfilerInitialized;
                minimizer.MinimizerInitialized    += minimizer_MinimizerInitialized;
                minimizer.ProfilingStarted        += (sender, e) => _server.Send(new ProfiledTestRunStarted());
                minimizer.ProfilerLoadError       += profiler_profilercorrupted;
                minimizer.SetManualUpdateProvider(() => _isPaused);
                initializeAllForPreProcessor(minimizer);
                if (disableAll)
                {
                    Pause();
                }
                IsRunning = true;
            }
        }
 public IObservable <FileExplorerNodeAction> GetActions()
 {
     return(_directoryWatcher.Scan()
            .Concat(_directoryWatcher.Watch())
            .Select(HandleChange));
 }
Exemplo n.º 9
0
 public void SetWatchDirectory(string directory)
 {
     _directoryToWatch = directory;
     _watcher.Watch(_directoryToWatch);
     _configuration.ValidateSettings();
 }