public void StartUp() { try { var application = _applicationSource.BuildApplication(); var runtime = application.Bootstrap(); _server = new EmbeddedFubuMvcServer(runtime, _physicalPath, _port); EventAggregator.SendMessage(new ApplicationStarted { ApplicationName = _applicationSource.GetType().Name, HomeAddress = _server.BaseAddress, Timestamp = DateTime.Now, Watcher = runtime.Factory.Get <AssetSettings>().CreateFileWatcherManifest() }); } catch (KatanaRightsException e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.Message, Message = "Access denied." }); } catch (Exception e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.ToString(), Message = "Bootstrapping {0} Failed!".ToFormat(_applicationSource.GetType().Name) }); } }
public void StartUp() { try { var application = _applicationSource.BuildApplication(); var runtime = application.Bootstrap(); _server = new EmbeddedFubuMvcServer(runtime, _physicalPath, _port); var list = new List <string>(); PackageRegistry.Packages.Each(pak => pak.ForFolder(BottleFiles.WebContentFolder, list.Add)); EventAggregator.SendMessage(new ApplicationStarted { ApplicationName = _applicationSource.GetType().Name, HomeAddress = _server.BaseAddress, Timestamp = DateTime.Now, BottleContentFolders = list.ToArray() }); } catch (Exception e) { EventAggregator.SendMessage(new InvalidApplication { ExceptionText = e.ToString(), Message = "Bootstrapping {0} Failed!".ToFormat(_applicationSource.GetType().Name) }); } }
public void AddApplication(IApplicationSource source) { var settings = ApplicationSettings.ReadByName(source.GetType().Name); var application = new ApplicationUnderTest(source, settings, _browserBuilder); _applications.AddApplication(application); }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, IBrowserLifecycle browser) : this(source.GetType().Name, settings.RootUrl, browser, () => { var app = source.BuildApplication(); return(app.Bootstrap().Factory); }) { }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, IBrowserLifecycle browser) : this(source.GetType().Name, settings.RootUrl, browser, () => { var app = source.BuildApplication(); return app.Bootstrap().Factory; }) { }
public ApplicationUnderTest(IApplicationSource source, ApplicationSettings settings, Func <IWebDriver> createWebDriver) : this(source.GetType().Name, settings.RootUrl, createWebDriver, () => { var app = source.BuildApplication(); app.ModifyRegistry(r => r.Services(x => { x.ReplaceService <ICurrentHttpRequest>(new StubCurrentHttpRequest { ApplicationRoot = settings.RootUrl }); })); app.Bootstrap(); return(app.Facility); }) { }