HttpSysServer 259 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. commit 58fb4f322e78330d0d8ac3b5b0d86763ca0ecc70
  2. Author: Pranav K <[email protected]>
  3. Date: Tue Nov 14 10:07:10 2017 -0800
  4. Update samples and tests to target netcoreapp2.1
  5. diff --git a/Directory.Build.props b/Directory.Build.props
  6. index a4d5ebdcd06..36f05acd3be 100644
  7. --- a/Directory.Build.props
  8. +++ b/Directory.Build.props
  9. @@ -1,4 +1,8 @@
  10. <Project>
  11. + <Import
  12. + Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))\AspNetCoreSettings.props"
  13. + Condition=" '$(CI)' != 'true' AND '$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), AspNetCoreSettings.props))' != '' " />
  14. +
  15. <Import Project="version.props" />
  16. <Import Project="build\dependencies.props" />
  17. diff --git a/korebuild-lock.txt b/korebuild-lock.txt
  18. index 45463cc71ec..95f46130145 100644
  19. --- a/korebuild-lock.txt
  20. +++ b/korebuild-lock.txt
  21. @@ -1,2 +1,2 @@
  22. -version:2.1.0-preview1-15549
  23. -commithash:f570e08585fec510dd60cd4bfe8795388b757a95
  24. +version:2.1.0-preview1-15567
  25. +commithash:903e3104807b1bb8cddd28bdef205b1e2dc021d1
  26. diff --git a/samples/HotAddSample/HotAddSample.csproj b/samples/HotAddSample/HotAddSample.csproj
  27. index 49d0e734635..caf6da74fed 100644
  28. --- a/samples/HotAddSample/HotAddSample.csproj
  29. +++ b/samples/HotAddSample/HotAddSample.csproj
  30. @@ -1,7 +1,7 @@
  31. <Project Sdk="Microsoft.NET.Sdk">
  32. <PropertyGroup>
  33. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  34. + <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
  35. <OutputType>Exe</OutputType>
  36. <ServerGarbageCollection>true</ServerGarbageCollection>
  37. </PropertyGroup>
  38. diff --git a/samples/SelfHostServer/SelfHostServer.csproj b/samples/SelfHostServer/SelfHostServer.csproj
  39. index 49d0e734635..caf6da74fed 100644
  40. --- a/samples/SelfHostServer/SelfHostServer.csproj
  41. +++ b/samples/SelfHostServer/SelfHostServer.csproj
  42. @@ -1,7 +1,7 @@
  43. <Project Sdk="Microsoft.NET.Sdk">
  44. <PropertyGroup>
  45. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  46. + <TargetFrameworks>netcoreapp2.1;net461</TargetFrameworks>
  47. <OutputType>Exe</OutputType>
  48. <ServerGarbageCollection>true</ServerGarbageCollection>
  49. </PropertyGroup>
  50. diff --git a/test/Directory.Build.props b/test/Directory.Build.props
  51. index c79812719aa..036af693c51 100644
  52. --- a/test/Directory.Build.props
  53. +++ b/test/Directory.Build.props
  54. @@ -1,6 +1,13 @@
  55. <Project>
  56. <Import Project="..\Directory.Build.props" />
  57. + <PropertyGroup>
  58. + <DeveloperBuildTestTfms>netcoreapp2.1</DeveloperBuildTestTfms>
  59. + <StandardTestTfms>$(DeveloperBuildTestTfms)</StandardTestTfms>
  60. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' ">$(StandardTestTfms);netcoreapp2.0</StandardTestTfms>
  61. + <StandardTestTfms Condition=" '$(DeveloperBuild)' != 'true' AND '$(OS)' == 'Windows_NT' ">$(StandardTestTfms);net461</StandardTestTfms>
  62. + </PropertyGroup>
  63. +
  64. <ItemGroup>
  65. <PackageReference Include="Internal.AspNetCore.Sdk" PrivateAssets="All" Version="$(InternalAspNetCoreSdkPackageVersion)" />
  66. <PackageReference Include="Microsoft.AspNetCore.Testing" Version="$(MicrosoftAspNetCoreTestingPackageVersion)" />
  67. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
  68. index 2ea7910a111..ef56e997cb4 100644
  69. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
  70. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseBodyTests.cs
  71. @@ -168,7 +168,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  72. context = await server.AcceptAsync(Utilities.DefaultTimeout);
  73. context.Response.Headers["Content-lenGth"] = " 20 ";
  74. context.Dispose();
  75. -#elif NETCOREAPP2_0
  76. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  77. #else
  78. #error Target framework needs to be updated
  79. #endif
  80. @@ -330,7 +330,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  81. writeTask = context.Response.Body.WriteAsync(new byte[10], 0, 10, cts.Token);
  82. Assert.True(writeTask.IsCanceled);
  83. context.Dispose();
  84. -#elif NETCOREAPP2_0
  85. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  86. #else
  87. #error Target framework needs to be updated
  88. #endif
  89. @@ -362,7 +362,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  90. writeTask = context.Response.Body.WriteAsync(new byte[10], 0, 10, cts.Token);
  91. Assert.True(writeTask.IsCanceled);
  92. context.Dispose();
  93. -#elif NETCOREAPP2_0
  94. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  95. #else
  96. #error Target framework needs to be updated
  97. #endif
  98. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
  99. index 86b377e7e33..727dd69ec68 100644
  100. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
  101. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseHeaderTests.cs
  102. @@ -252,7 +252,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  103. Assert.Equal(0, response.ContentLength);
  104. Assert.NotNull(response.Headers["Date"]);
  105. Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
  106. -#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
  107. +#if NETCOREAPP2_0 || NETCOREAPP2_1 // WebHeaderCollection.GetValues() not available in CoreCLR.
  108. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
  109. #elif NET461
  110. Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
  111. @@ -283,7 +283,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  112. Assert.Equal(0, response.ContentLength);
  113. Assert.NotNull(response.Headers["Date"]);
  114. Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
  115. -#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
  116. +#if NETCOREAPP2_0 || NETCOREAPP2_1 // WebHeaderCollection.GetValues() not available in CoreCLR.
  117. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
  118. #elif NET461
  119. Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
  120. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
  121. index f1c1f4ba263..2a962c69f2e 100644
  122. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
  123. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ResponseSendFileTests.cs
  124. @@ -371,7 +371,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  125. writeTask = context.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token);
  126. Assert.True(writeTask.IsCanceled);
  127. context.Dispose();
  128. -#elif NETCOREAPP2_0
  129. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  130. #else
  131. #error Target framework needs to be updated
  132. #endif
  133. @@ -403,7 +403,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  134. writeTask = context.Response.SendFileAsync(AbsoluteFilePath, 0, null, cts.Token);
  135. Assert.True(writeTask.IsCanceled);
  136. context.Dispose();
  137. -#elif NETCOREAPP2_0
  138. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  139. #else
  140. #error Target framework needs to be updated
  141. #endif
  142. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
  143. index e12488f13e8..60c95a94f1c 100644
  144. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
  145. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Listener/ServerTests.cs
  146. @@ -188,7 +188,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys.Listener
  147. // HttpClient re-tries the request because it doesn't know if the request was received.
  148. context = await server.AcceptAsync(Utilities.DefaultTimeout);
  149. context.Abort();
  150. -#elif NETCOREAPP2_0
  151. +#elif NETCOREAPP2_0 || NETCOREAPP2_1
  152. #else
  153. #error Target framework needs to be updated
  154. #endif
  155. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
  156. index ed1c3689139..dd4dc97dbc4 100644
  157. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
  158. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests.csproj
  159. @@ -1,8 +1,7 @@
  160. <Project Sdk="Microsoft.NET.Sdk">
  161. <PropertyGroup>
  162. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  163. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  164. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  165. </PropertyGroup>
  166. <ItemGroup>
  167. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
  168. index bec341b50ff..ec93832e184 100644
  169. --- a/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
  170. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.FunctionalTests/ResponseHeaderTests.cs
  171. @@ -81,7 +81,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
  172. Assert.Equal(0, response.ContentLength);
  173. Assert.NotNull(response.Headers["Date"]);
  174. Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
  175. -#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
  176. +#if NETCOREAPP2_0 || NETCOREAPP2_1 // WebHeaderCollection.GetValues() not available in CoreCLR.
  177. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
  178. #elif NET461
  179. Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate"));
  180. @@ -111,7 +111,7 @@ namespace Microsoft.AspNetCore.Server.HttpSys
  181. Assert.Equal(0, response.ContentLength);
  182. Assert.NotNull(response.Headers["Date"]);
  183. Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]);
  184. -#if NETCOREAPP2_0 // WebHeaderCollection.GetValues() not available in CoreCLR.
  185. +#if NETCOREAPP2_0 || NETCOREAPP2_1 // WebHeaderCollection.GetValues() not available in CoreCLR.
  186. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
  187. #elif NET461
  188. Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));
  189. diff --git a/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj b/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
  190. index 0429172ecd4..5628726d51b 100644
  191. --- a/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
  192. +++ b/test/Microsoft.AspNetCore.Server.HttpSys.Tests/Microsoft.AspNetCore.Server.HttpSys.Tests.csproj
  193. @@ -1,8 +1,7 @@
  194. <Project Sdk="Microsoft.NET.Sdk">
  195. <PropertyGroup>
  196. - <TargetFrameworks>netcoreapp2.0;net461</TargetFrameworks>
  197. - <TargetFrameworks Condition=" '$(OS)' != 'Windows_NT' ">netcoreapp2.0</TargetFrameworks>
  198. + <TargetFrameworks>$(StandardTestTfms)</TargetFrameworks>
  199. </PropertyGroup>
  200. <ItemGroup>