Added StartupWithIStartupFilter (#236)

Added StartupWithIStartupFilter
This commit is contained in:
jhkimnew 2017-11-07 16:43:23 -08:00 committed by GitHub
parent 89f6f16ba5
commit bd18430428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 7 deletions

View File

@ -718,6 +718,7 @@ namespace AspNetCoreModule.Test
if (!isGraceFullShutdownEnabled)
{
iisConfig.SetANCMConfig(testSite.SiteName, testSite.AspNetCoreApp.Name, "environmentVariable", new string[] { "GracefulShutdown", "disabled" });
iisConfig.SetANCMConfig(testSite.SiteName, testSite.AspNetCoreApp.Name, "environmentVariable", new string[] { "ANCMTestStartupClassName", "StartupWithShutdownDisabled" });
expectedGracefulShutdownResponseStatusCode = "200";
}

View File

@ -80,14 +80,9 @@ namespace AspnetCoreModule.TestSites.Standard
.UseIISIntegration()
.UseStartup<StartupNtlmAuthentication>();
}
else
else if (startUpClassString == "StartupWithShutdownDisabled")
{
throw new System.Exception("Invalid startup class name : " + startUpClassString);
}
}
else
{
builder = new WebHostBuilder()
builder = new WebHostBuilder()
.ConfigureServices(services =>
{
const string PairingToken = "TOKEN";
@ -98,6 +93,18 @@ namespace AspnetCoreModule.TestSites.Standard
})
.UseConfiguration(config)
.UseStartup<Startup>();
}
else
{
throw new Exception("Invalid startup class name : " + startUpClassString);
}
}
else
{
builder = new WebHostBuilder()
.UseConfiguration(config)
.UseIISIntegration()
.UseStartup<Startup>();
}
string startupDelay = Environment.GetEnvironmentVariable("ANCMTestStartUpDelay");