From 9885377148e9d50ec45f9c7ca44c8b645a415f6b Mon Sep 17 00:00:00 2001 From: John Luo Date: Sun, 17 Jan 2016 16:13:21 -0800 Subject: [PATCH] Reacting to hosting rename --- samples/LargeResponseApp/Startup.cs | 6 +++--- samples/SampleApp/Startup.cs | 7 +++---- samples/SampleApp/wwwroot/web.config | 9 --------- .../AddressRegistrationTests.cs | 6 +++--- .../PathBaseTests.cs | 6 +++--- .../RequestTests.cs | 18 +++++++++--------- .../ResponseTests.cs | 18 +++++++++--------- .../ThreadCountTests.cs | 6 +++--- 8 files changed, 33 insertions(+), 43 deletions(-) delete mode 100644 samples/SampleApp/wwwroot/web.config diff --git a/samples/LargeResponseApp/Startup.cs b/samples/LargeResponseApp/Startup.cs index 5052e96f59..241d754a38 100644 --- a/samples/LargeResponseApp/Startup.cs +++ b/samples/LargeResponseApp/Startup.cs @@ -38,12 +38,12 @@ namespace LargeResponseApp public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseStartup() .Build(); - application.Run(); + host.Run(); } } } diff --git a/samples/SampleApp/Startup.cs b/samples/SampleApp/Startup.cs index 8d4b97eda7..5ff5a14fa5 100644 --- a/samples/SampleApp/Startup.cs +++ b/samples/SampleApp/Startup.cs @@ -7,7 +7,6 @@ using System.Security.Cryptography.X509Certificates; using Microsoft.AspNet.Builder; using Microsoft.AspNet.Hosting; using Microsoft.AspNet.Http; -using Microsoft.AspNet.Http.Features; using Microsoft.AspNet.Server.Kestrel; using Microsoft.AspNet.Server.Kestrel.Filter; using Microsoft.Extensions.Logging; @@ -65,8 +64,8 @@ namespace SampleApp public static void Main(string[] args) { - var application = new WebApplicationBuilder() - .UseConfiguration(WebApplicationConfiguration.GetDefault(args)) + var host = new WebHostBuilder() + .UseDefaultConfiguration(args) .UseStartup() .Build(); @@ -75,7 +74,7 @@ namespace SampleApp //addresses.Clear(); //addresses.Add("http://unix:/tmp/kestrel-test.sock"); - application.Run(); + host.Run(); } } } \ No newline at end of file diff --git a/samples/SampleApp/wwwroot/web.config b/samples/SampleApp/wwwroot/web.config deleted file mode 100644 index 9a0d90abf8..0000000000 --- a/samples/SampleApp/wwwroot/web.config +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs index 6a936ea3db..c553af03b0 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/AddressRegistrationTests.cs @@ -40,14 +40,14 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }) .Build(); - var applicationBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(ConfigureEchoAddress); - using (var app = applicationBuilder.Build()) + using (var host = hostBuilder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/PathBaseTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/PathBaseTests.cs index ddad81932e..e44a651c4c 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/PathBaseTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/PathBaseTests.cs @@ -79,7 +79,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests { "server.urls", registerAddress } }).Build(); - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -94,9 +94,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = builder.Build()) + using (var host = builder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs index 623e85c8ff..fdba322cb3 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/RequestTests.cs @@ -29,7 +29,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }) .Build(); - var applicationBuilder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -54,9 +54,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = applicationBuilder.Build()) + using (var host = builder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { @@ -100,7 +100,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests { "server.urls", "http://localhost:8791" } }).Build(); - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -112,10 +112,10 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = builder.Build()) + using (var host = builder.Build()) using (var client = new HttpClient()) { - app.Start(); + host.Start(); client.DefaultRequestHeaders.Connection.Clear(); client.DefaultRequestHeaders.Connection.Add("close"); @@ -132,7 +132,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests { "server.urls", $"http://{registerAddress}:{port}" } }).Build(); - var builder = new WebApplicationBuilder() + var builder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -151,10 +151,10 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = builder.Build()) + using (var host = builder.Build()) using (var client = new HttpClient()) { - app.Start(); + host.Start(); var response = await client.GetAsync($"http://{requestAddress}:{port}/"); response.EnsureSuccessStatusCode(); diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ResponseTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ResponseTests.cs index 993ea06aa7..d4f6b529aa 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ResponseTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ResponseTests.cs @@ -30,7 +30,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }) .Build(); - var applicationBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -52,9 +52,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = applicationBuilder.Build()) + using (var host = hostBuilder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { @@ -90,7 +90,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }) .Build(); - var hostBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -103,9 +103,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = hostBuilder.Build()) + using (var host = hostBuilder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { @@ -141,7 +141,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests var onStartingCalled = false; var onCompletedCalled = false; - var hostBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -156,9 +156,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = hostBuilder.Build()) + using (var host = hostBuilder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) { diff --git a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ThreadCountTests.cs b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ThreadCountTests.cs index a56fa6b47c..0d4324926b 100644 --- a/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ThreadCountTests.cs +++ b/test/Microsoft.AspNet.Server.Kestrel.FunctionalTests/ThreadCountTests.cs @@ -23,7 +23,7 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }) .Build(); - var applicationBuilder = new WebApplicationBuilder() + var hostBuilder = new WebHostBuilder() .UseConfiguration(config) .UseServer("Microsoft.AspNet.Server.Kestrel") .Configure(app => @@ -36,9 +36,9 @@ namespace Microsoft.AspNet.Server.Kestrel.FunctionalTests }); }); - using (var app = applicationBuilder.Build()) + using (var host = hostBuilder.Build()) { - app.Start(); + host.Start(); using (var client = new HttpClient()) {