From 75144a4350dedc34705bec2864a6ddedb78425da Mon Sep 17 00:00:00 2001 From: Pavel Krymets Date: Thu, 14 Apr 2016 15:24:10 -0700 Subject: [PATCH] Migrate tests, tools and samples to portable --- samples/HelloWorld/project.json | 10 ++++++---- samples/HotAddSample/project.json | 10 ++++++---- samples/SelfHostServer/project.json | 10 ++++++---- .../RequestBodyTests.cs | 2 +- .../ResponseHeaderTests.cs | 4 ++-- .../project.json | 7 +++++-- .../ResponseBodyTests.cs | 6 +++--- .../ResponseHeaderTests.cs | 4 ++-- .../ServerTests.cs | 2 +- .../project.json | 7 +++++-- 10 files changed, 37 insertions(+), 25 deletions(-) diff --git a/samples/HelloWorld/project.json b/samples/HelloWorld/project.json index f1daae728c..ff0fe111a8 100644 --- a/samples/HelloWorld/project.json +++ b/samples/HelloWorld/project.json @@ -4,17 +4,19 @@ }, "dependencies": { "Microsoft.Net.Http.Server": "0.1.0-*", - "Microsoft.Net.WebSockets.Server": "0.1.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Net.WebSockets.Server": "0.1.0-*" }, "commands": { "sample": "HelloWorld" }, "frameworks": { "net451": {}, - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { - "NETStandard.Library": "1.5.0-*" + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } }, "imports": [ "dnxcore50" diff --git a/samples/HotAddSample/project.json b/samples/HotAddSample/project.json index d7c37ec446..36d50c8f32 100644 --- a/samples/HotAddSample/project.json +++ b/samples/HotAddSample/project.json @@ -2,8 +2,7 @@ "version": "1.0.0-*", "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "compilationOptions": { "emitEntryPoint": true @@ -13,9 +12,12 @@ }, "frameworks": { "net451": {}, - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { - "NETStandard.Library": "1.5.0-*" + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } }, "imports": [ "dnxcore50" diff --git a/samples/SelfHostServer/project.json b/samples/SelfHostServer/project.json index b662bed05f..471564e28b 100644 --- a/samples/SelfHostServer/project.json +++ b/samples/SelfHostServer/project.json @@ -1,8 +1,7 @@ { "dependencies": { "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", - "Microsoft.Extensions.Logging.Console": "1.0.0-*", - "Microsoft.NETCore.Platforms": "1.0.1-*" + "Microsoft.Extensions.Logging.Console": "1.0.0-*" }, "compilationOptions": { "emitEntryPoint": true @@ -12,9 +11,12 @@ }, "frameworks": { "net451": {}, - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { - "NETStandard.Library": "1.5.0-*" + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + } }, "imports": [ "dnxcore50" diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs index 3e140a9ec8..62bd825730 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/RequestBodyTests.cs @@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal("Hello World", response); } } -#if !NETSTANDARDAPP1_5 +#if !NETCOREAPP1_0 [Fact] public async Task RequestBody_ReadBeginEnd_Success() { diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs index 7242b3d17c..9d31c385b5 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/ResponseHeaderTests.cs @@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETCOREAPP1_0 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); @@ -122,7 +122,7 @@ namespace Microsoft.AspNetCore.Server.WebListener Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETCOREAPP1_0 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); diff --git a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json index 351c9359fc..7592527454 100644 --- a/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json +++ b/test/Microsoft.AspNetCore.Server.WebListener.FunctionalTests/project.json @@ -6,13 +6,16 @@ "xunit": "2.1.0" }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + }, "System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Requests": "4.0.11-*", "System.Net.WebHeaderCollection": "4.0.1-*", "dotnet-test-xunit": "1.0.0-dev-*", - "NETStandard.Library": "1.5.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [ diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs index 3b195b2fc2..9b990f777c 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseBodyTests.cs @@ -153,7 +153,7 @@ namespace Microsoft.Net.Http.Server var context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; context.Dispose(); -#if !NETSTANDARDAPP1_5 +#if !NETCOREAPP1_0 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; @@ -175,7 +175,7 @@ namespace Microsoft.Net.Http.Server context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Body.Write(new byte[5], 0, 5); context.Dispose(); -#if !NETSTANDARDAPP1_5 +#if !NETCOREAPP1_0 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 20 "; @@ -199,7 +199,7 @@ namespace Microsoft.Net.Http.Server context.Response.Body.Write(new byte[5], 0, 5); Assert.Throws(() => context.Response.Body.Write(new byte[6], 0, 6)); context.Dispose(); -#if !NETSTANDARDAPP1_5 +#if !NETCOREAPP1_0 // HttpClient retries the request because it didn't get a response. context = await server.GetContextAsync(); context.Response.Headers["Content-lenGth"] = " 10 "; diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs index a3c29a0991..3a498ecbda 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ResponseHeaderTests.cs @@ -217,7 +217,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETCOREAPP1_0 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); @@ -246,7 +246,7 @@ namespace Microsoft.Net.Http.Server Assert.Equal(0, response.ContentLength); Assert.NotNull(response.Headers["Date"]); Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); -#if NETSTANDARDAPP1_5 // WebHeaderCollection.GetValues() not available in CoreCLR. +#if NETCOREAPP1_0 // WebHeaderCollection.GetValues() not available in CoreCLR. Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]); #else Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs b/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs index c1d87dfc0c..eebf509011 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/ServerTests.cs @@ -123,7 +123,7 @@ namespace Microsoft.Net.Http.Server context.Abort(); Assert.True(canceled.WaitOne(interval), "Aborted"); Assert.True(ct.IsCancellationRequested, "IsCancellationRequested"); -#if !NETSTANDARDAPP1_5 +#if !NETCOREAPP1_0 // HttpClient re-tries the request because it doesn't know if the request was received. context = await server.GetContextAsync(); context.Abort(); diff --git a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json index 7c29176861..159b5be103 100644 --- a/test/Microsoft.Net.Http.Server.FunctionalTests/project.json +++ b/test/Microsoft.Net.Http.Server.FunctionalTests/project.json @@ -7,14 +7,17 @@ "xunit": "2.1.0" }, "frameworks": { - "netstandardapp1.5": { + "netcoreapp1.0": { "dependencies": { + "Microsoft.NETCore.App": { + "version": "1.0.0-*", + "type": "platform" + }, "System.Net.Http": "4.0.1-*", "System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Requests": "4.0.11-*", "System.Net.WebSockets.Client": "4.0.0-*", "dotnet-test-xunit": "1.0.0-dev-*", - "NETStandard.Library": "1.5.0-*", "System.Diagnostics.Process": "4.1.0-*" }, "imports": [