fix NETFX and UWP build issues
authorGeoff Kizer <geoffrek>
Tue, 9 Jul 2019 23:59:44 +0000 (16:59 -0700)
committerGeoff Kizer <geoffrek>
Sun, 14 Jul 2019 00:17:32 +0000 (17:17 -0700)
Commit migrated from https://github.com/dotnet/corefx/commit/b2216d60d2a2f9416eadb4bae015eb1524407d71

src/libraries/Common/tests/System/Net/Configuration.Http.cs
src/libraries/System.Diagnostics.DiagnosticSource/tests/HttpHandlerDiagnosticListenerTests.cs
src/libraries/System.Net.Http/tests/FunctionalTests/PostScenarioUWPTest.cs

index 2d38bdb..a1417d3 100644 (file)
@@ -78,7 +78,7 @@ namespace System.Net.Test.Common
 
             public static readonly RemoteServer RemoteHttp11Server = new RemoteServer(new Uri("http://" + Host + "/"), HttpVersion.Version11);
             public static readonly RemoteServer RemoteSecureHttp11Server = new RemoteServer(new Uri("https://" + SecureHost + "/"), HttpVersion.Version11);
-            public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), HttpVersion.Version20);
+            public static readonly RemoteServer RemoteHttp2Server = new RemoteServer(new Uri("https://" + Http2Host + "/"), new Version(2, 0));
 
             public static readonly IEnumerable<RemoteServer> RemoteServers = new RemoteServer[] { RemoteHttp11Server, RemoteSecureHttp11Server, RemoteHttp2Server };
 
index e72664e..f0a1aea 100644 (file)
@@ -334,7 +334,7 @@ namespace System.Diagnostics.Tests
                 using (var client = new HttpClient())
                 {
                     Uri uriWithRedirect =
-                        Configuration.Http.RedirectUriForDestinationUri(true, 302, Configuration.Http.RemoteEchoServer, 10);
+                        Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, Configuration.Http.RemoteEchoServer, 10);
                     (await client.GetAsync(uriWithRedirect)).Dispose();
                 }
 
@@ -550,7 +550,7 @@ namespace System.Diagnostics.Tests
                 for (int i = 0; i < 10; i++)
                 {
                     Uri uriWithRedirect =
-                        Configuration.Http.RedirectUriForDestinationUri(true, 302, new Uri($"{Configuration.Http.RemoteEchoServer}?q={i}"), 3);
+                        Configuration.Http.RemoteSecureHttp11Server.RedirectUriForDestinationUri(302, new Uri($"{Configuration.Http.RemoteEchoServer}?q={i}"), 3);
 
                     requestData[uriWithRedirect] = null;
                 }
index 6834109..3787f49 100644 (file)
@@ -30,7 +30,7 @@ namespace System.Net.Http.Functional.Tests
                 // re-POST'd to the server.
                 string username = "testuser";
                 string password = "password";
-                Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password);
+                Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password);
                 HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String);
                 handler.Credentials = new NetworkCredential(username, password);
 
@@ -54,7 +54,7 @@ namespace System.Net.Http.Functional.Tests
             {
                 string username = "testuser";
                 string password = "password";
-                Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password);            
+                Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password);
                 HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String);
                 handler.Credentials = new NetworkCredential(username, password);
 
@@ -78,7 +78,7 @@ namespace System.Net.Http.Functional.Tests
             {
                 string username = "testuser";
                 string password = "password";
-                Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password);            
+                Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password);
                 HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String);
                 handler.Credentials = new NetworkCredential(username, password);
 
@@ -106,7 +106,7 @@ namespace System.Net.Http.Functional.Tests
             {
                 string username = "testuser";
                 string password = "password";
-                Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password);            
+                Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password);
                 HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String);
                 handler.Credentials = new NetworkCredential(username, password);
 
@@ -134,7 +134,7 @@ namespace System.Net.Http.Functional.Tests
             {
                 string username = "testuser";
                 string password = "password";
-                Uri uri = Configuration.Http.BasicAuthUriForCreds(secure: false, userName: username, password: password);            
+                Uri uri = Configuration.Http.RemoteHttp11Server.BasicAuthUriForCreds(userName: username, password: password);
                 HttpClientHandler handler = CreateHttpClientHandler(useSocketsHttpHandlerString, useHttp2String);
                 handler.Credentials = new NetworkCredential(username, password);