Migrate tests, tools and samples to portable

This commit is contained in:
Pavel Krymets 2016-04-14 15:24:10 -07:00
parent 316fbccd1e
commit 75144a4350
10 changed files with 37 additions and 25 deletions

View File

@ -4,17 +4,19 @@
}, },
"dependencies": { "dependencies": {
"Microsoft.Net.Http.Server": "0.1.0-*", "Microsoft.Net.Http.Server": "0.1.0-*",
"Microsoft.Net.WebSockets.Server": "0.1.0-*", "Microsoft.Net.WebSockets.Server": "0.1.0-*"
"Microsoft.NETCore.Platforms": "1.0.1-*"
}, },
"commands": { "commands": {
"sample": "HelloWorld" "sample": "HelloWorld"
}, },
"frameworks": { "frameworks": {
"net451": {}, "net451": {},
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.5.0-*" "Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}, },
"imports": [ "imports": [
"dnxcore50" "dnxcore50"

View File

@ -2,8 +2,7 @@
"version": "1.0.0-*", "version": "1.0.0-*",
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*"
"Microsoft.NETCore.Platforms": "1.0.1-*"
}, },
"compilationOptions": { "compilationOptions": {
"emitEntryPoint": true "emitEntryPoint": true
@ -13,9 +12,12 @@
}, },
"frameworks": { "frameworks": {
"net451": {}, "net451": {},
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.5.0-*" "Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}, },
"imports": [ "imports": [
"dnxcore50" "dnxcore50"

View File

@ -1,8 +1,7 @@
{ {
"dependencies": { "dependencies": {
"Microsoft.AspNetCore.Server.WebListener": "0.1.0-*", "Microsoft.AspNetCore.Server.WebListener": "0.1.0-*",
"Microsoft.Extensions.Logging.Console": "1.0.0-*", "Microsoft.Extensions.Logging.Console": "1.0.0-*"
"Microsoft.NETCore.Platforms": "1.0.1-*"
}, },
"compilationOptions": { "compilationOptions": {
"emitEntryPoint": true "emitEntryPoint": true
@ -12,9 +11,12 @@
}, },
"frameworks": { "frameworks": {
"net451": {}, "net451": {},
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"NETStandard.Library": "1.5.0-*" "Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
}
}, },
"imports": [ "imports": [
"dnxcore50" "dnxcore50"

View File

@ -63,7 +63,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
Assert.Equal("Hello World", response); Assert.Equal("Hello World", response);
} }
} }
#if !NETSTANDARDAPP1_5 #if !NETCOREAPP1_0
[Fact] [Fact]
public async Task RequestBody_ReadBeginEnd_Success() public async Task RequestBody_ReadBeginEnd_Success()
{ {

View File

@ -94,7 +94,7 @@ namespace Microsoft.AspNetCore.Server.WebListener
Assert.Equal(0, response.ContentLength); Assert.Equal(0, response.ContentLength);
Assert.NotNull(response.Headers["Date"]); Assert.NotNull(response.Headers["Date"]);
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); 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"]); Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
#else #else
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); 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.Equal(0, response.ContentLength);
Assert.NotNull(response.Headers["Date"]); Assert.NotNull(response.Headers["Date"]);
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); 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"]); Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
#else #else
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));

View File

@ -6,13 +6,16 @@
"xunit": "2.1.0" "xunit": "2.1.0"
}, },
"frameworks": { "frameworks": {
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Http.WinHttpHandler": "4.0.0-*",
"System.Net.Requests": "4.0.11-*", "System.Net.Requests": "4.0.11-*",
"System.Net.WebHeaderCollection": "4.0.1-*", "System.Net.WebHeaderCollection": "4.0.1-*",
"dotnet-test-xunit": "1.0.0-dev-*", "dotnet-test-xunit": "1.0.0-dev-*",
"NETStandard.Library": "1.5.0-*",
"System.Diagnostics.Process": "4.1.0-*" "System.Diagnostics.Process": "4.1.0-*"
}, },
"imports": [ "imports": [

View File

@ -153,7 +153,7 @@ namespace Microsoft.Net.Http.Server
var context = await server.GetContextAsync(); var context = await server.GetContextAsync();
context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Headers["Content-lenGth"] = " 20 ";
context.Dispose(); context.Dispose();
#if !NETSTANDARDAPP1_5 #if !NETCOREAPP1_0
// HttpClient retries the request because it didn't get a response. // HttpClient retries the request because it didn't get a response.
context = await server.GetContextAsync(); context = await server.GetContextAsync();
context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Headers["Content-lenGth"] = " 20 ";
@ -175,7 +175,7 @@ namespace Microsoft.Net.Http.Server
context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Headers["Content-lenGth"] = " 20 ";
context.Response.Body.Write(new byte[5], 0, 5); context.Response.Body.Write(new byte[5], 0, 5);
context.Dispose(); context.Dispose();
#if !NETSTANDARDAPP1_5 #if !NETCOREAPP1_0
// HttpClient retries the request because it didn't get a response. // HttpClient retries the request because it didn't get a response.
context = await server.GetContextAsync(); context = await server.GetContextAsync();
context.Response.Headers["Content-lenGth"] = " 20 "; context.Response.Headers["Content-lenGth"] = " 20 ";
@ -199,7 +199,7 @@ namespace Microsoft.Net.Http.Server
context.Response.Body.Write(new byte[5], 0, 5); context.Response.Body.Write(new byte[5], 0, 5);
Assert.Throws<InvalidOperationException>(() => context.Response.Body.Write(new byte[6], 0, 6)); Assert.Throws<InvalidOperationException>(() => context.Response.Body.Write(new byte[6], 0, 6));
context.Dispose(); context.Dispose();
#if !NETSTANDARDAPP1_5 #if !NETCOREAPP1_0
// HttpClient retries the request because it didn't get a response. // HttpClient retries the request because it didn't get a response.
context = await server.GetContextAsync(); context = await server.GetContextAsync();
context.Response.Headers["Content-lenGth"] = " 10 "; context.Response.Headers["Content-lenGth"] = " 10 ";

View File

@ -217,7 +217,7 @@ namespace Microsoft.Net.Http.Server
Assert.Equal(0, response.ContentLength); Assert.Equal(0, response.ContentLength);
Assert.NotNull(response.Headers["Date"]); Assert.NotNull(response.Headers["Date"]);
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); 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"]); Assert.Equal("custom1, and custom2, custom3", response.Headers["WWW-Authenticate"]);
#else #else
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("WWW-Authenticate")); 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.Equal(0, response.ContentLength);
Assert.NotNull(response.Headers["Date"]); Assert.NotNull(response.Headers["Date"]);
Assert.Equal("Microsoft-HTTPAPI/2.0", response.Headers["Server"]); 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"]); Assert.Equal("custom1, and custom2, custom3", response.Headers["Custom-Header1"]);
#else #else
Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1")); Assert.Equal(new string[] { "custom1, and custom2", "custom3" }, response.Headers.GetValues("Custom-Header1"));

View File

@ -123,7 +123,7 @@ namespace Microsoft.Net.Http.Server
context.Abort(); context.Abort();
Assert.True(canceled.WaitOne(interval), "Aborted"); Assert.True(canceled.WaitOne(interval), "Aborted");
Assert.True(ct.IsCancellationRequested, "IsCancellationRequested"); 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. // HttpClient re-tries the request because it doesn't know if the request was received.
context = await server.GetContextAsync(); context = await server.GetContextAsync();
context.Abort(); context.Abort();

View File

@ -7,14 +7,17 @@
"xunit": "2.1.0" "xunit": "2.1.0"
}, },
"frameworks": { "frameworks": {
"netstandardapp1.5": { "netcoreapp1.0": {
"dependencies": { "dependencies": {
"Microsoft.NETCore.App": {
"version": "1.0.0-*",
"type": "platform"
},
"System.Net.Http": "4.0.1-*", "System.Net.Http": "4.0.1-*",
"System.Net.Http.WinHttpHandler": "4.0.0-*", "System.Net.Http.WinHttpHandler": "4.0.0-*",
"System.Net.Requests": "4.0.11-*", "System.Net.Requests": "4.0.11-*",
"System.Net.WebSockets.Client": "4.0.0-*", "System.Net.WebSockets.Client": "4.0.0-*",
"dotnet-test-xunit": "1.0.0-dev-*", "dotnet-test-xunit": "1.0.0-dev-*",
"NETStandard.Library": "1.5.0-*",
"System.Diagnostics.Process": "4.1.0-*" "System.Diagnostics.Process": "4.1.0-*"
}, },
"imports": [ "imports": [