/// <summary> /// Initializes a new instance of the <see cref="LivenessCheckingStrategy"/> class. /// </summary> internal LivenessCheckingStrategy(Configuration configuration, SpecificationEngine specificationEngine, SchedulingStrategy strategy) { this.Configuration = configuration; this.SpecificationEngine = specificationEngine; this.SchedulingStrategy = strategy; }
private SpecificationEngine buildBatchedEngine(string tracingStyle) { IBatchObserver batchObserver = new BatchObserver(); IExecutionObserver executionObserver = new NulloObserver(); if ("TeamCity" == tracingStyle) { batchObserver = new TeamCityBatchObserver(batchObserver); executionObserver = new TeamCityExecutionObserver(); } var executionMode = new BatchExecutionMode(batchObserver); var runner = new SpecRunner(executionMode, _system, _specExpiration); var engine = new SpecificationEngine( _system, runner, executionObserver); _controller = new BatchController(engine, batchObserver); _services.Add(engine); EventAggregator.Messaging.AddListener(_controller); return(engine); }
/// <summary> /// Sets the specification engine. /// </summary> internal void SetSpecificationEngine(SpecificationEngine specificationEngine) { if (this.Configuration.IsLivenessCheckingEnabled) { this.Strategy = new TemperatureCheckingStrategy(this.Configuration, specificationEngine, this.Strategy); } }
/// <summary> /// Sets the specification engine. /// </summary> internal void SetSpecificationEngine(SpecificationEngine specificationEngine) { if (this.Strategy is TemperatureCheckingStrategy temperatureCheckingStrategy) { temperatureCheckingStrategy.SetSpecificationEngine(specificationEngine); } }
/// <summary> /// Sets the specification engine. /// </summary> internal void SetSpecificationEngine(SpecificationEngine specificationEngine) { if (this.SchedulingPolicy is SchedulingPolicy.Systematic && this.Configuration.IsLivenessCheckingEnabled) { this.Strategy = new TemperatureCheckingStrategy(this.Configuration, specificationEngine, this.Strategy as SystematicStrategy); } }
public void Start(EngineMode mode, Project project, MarshalByRefObject remoteListener) { Project.CurrentProject = project; EventAggregator.Start((IRemoteListener)remoteListener); _project = project; Type systemType = null; try { systemType = _project.DetermineSystemType(); _system = Activator.CreateInstance(systemType).As <ISystem>(); _services.Add(_system); var timeZone = new MachineTimeZoneContext(); var clock = new Clock(); var systemTime = new SystemTime(clock, timeZone); _specExpiration = new SpecExpiration(systemTime); if (mode == EngineMode.Interactive) { _engine = buildUserInterfaceEngine(); } else { _engine = buildBatchedEngine(project.TracingStyle); } _engine.Start(project.StopConditions); } catch (Exception e) { var message = new SystemRecycled { error = e.ToString(), success = false, }; if (systemType != null) { message.system_name = systemType.AssemblyQualifiedName; } EventAggregator.SendMessage(message); } AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; AppDomain.CurrentDomain.DomainUnload += CurrentDomainOnDomainUnload; }
private SpecificationEngine buildUserInterfaceEngine() { var observer = new UserInterfaceObserver(); var runner = new SpecRunner(new UserInterfaceExecutionMode(observer), _system, _specExpiration); var executionObserver = new UserInterfaceExecutionObserver(); var engine = new SpecificationEngine(_system, runner, executionObserver); _controller = new EngineController(engine, observer, runner); // Super hokey, but we need some way to feed the spec started // event up to EngineController // TODO -- maybe pull the IExecutionQueue concept from 1-2 back out executionObserver.Controller = (EngineController)_controller; _services.Add(observer); _services.Add(engine); EventAggregator.Messaging.AddListener(_controller); return(engine); }
public SpecifiesStatically() : base(new TypeStoreFactory()) { this.engine = new SpecificationEngine(this); }
protected Specifies() : base(new TypeStoreFactory()) { instanceForCleanUp = this; this.engine = new SpecificationEngine(this); }
/// <summary> /// Sets the specification engine. /// </summary> internal void SetSpecificationEngine(SpecificationEngine specificationEngine) { this.SpecificationEngine = specificationEngine; }
/// <summary> /// Initializes a new instance of the <see cref="TemperatureCheckingStrategy"/> class. /// </summary> internal TemperatureCheckingStrategy(Configuration configuration, SpecificationEngine specificationEngine, SchedulingStrategy strategy) : base(configuration, specificationEngine, strategy) { }
public Specifies() : base(new TypeStoreFactory()) { this.engine = new SpecificationEngine(this); this.engine.Run(); }