Beispiel #1
0
        public void Start(Project project)
        {
            if (_running != null)
            {
                Console.WriteLine($"AGENT: Trying to start specification runner for {_running.GetType().Name} at {project.ProjectPath} and port {project.Port}");
            }

            Project.CurrentProject = project;


            _project = project;

            Type systemType = null;



            try
            {
                if (_running == null)
                {
                    buildRunningSystem();
                }

                if (project.Mode == EngineMode.ExportOnly)
                {
                    EventAggregator.SendMessage(_running.RecycledMessage);
                    return;
                }


                _engine = project.Mode == EngineMode.Interactive
                    ? buildUserInterfaceEngine()
                    : buildBatchedEngine(project.TracingStyle);


                _engine.Start(project.StopConditions);


                ConsoleWriter.Write("AGENT: Specification running engine ready at " + project.ProjectPath);
            }
            catch (Exception e)
            {
                StorytellerAgent.LogFailure(e);

                ConsoleWriter.Write(ConsoleColor.Red, e.ToString());

                var message = new SystemRecycled
                {
                    error   = e.ToString(),
                    success = false,
                };

                EventAggregator.SendMessage(message);
            }
        }
Beispiel #2
0
        public void Start(Project project)
        {
            if (_running != null)
            {
                Console.WriteLine($"AGENT: Trying to start specification runner for {_running.GetType().Name} at {project.ProjectPath} and port {project.Port}");
            }

            Project.CurrentProject = project;


            _project = project;


            try
            {
                _engine = buildUserInterfaceEngine();


                _engine.Start(project.StopConditions);


                ConsoleWriter.Write("AGENT: Specification running engine ready at " + project.ProjectPath);
            }
            catch (Exception e)
            {
                StorytellerAgent.LogFailure(e);

                ConsoleWriter.Write(ConsoleColor.Red, e.ToString());

                var message = new SystemRecycled
                {
                    error   = e.ToString(),
                    success = false,
                };

                EventAggregator.SendMessage(message);
            }
        }