Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/aspnetwebstack.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidmatson <dmatson@microsoft.com>2012-10-25 03:45:13 +0400
committerdavidmatson <dmatson@microsoft.com>2012-10-31 22:12:56 +0400
commitc942cabd8a5d280672c288f43fab59e85f11c6da (patch)
tree268af06e250162f9889db551db8063a7e0b17d48
parentbfa28d1ddbcad433f41b832f54ac952491490449 (diff)
Remove need for TestHttpNamespace.bat.
The only reason we needed to have TestHttpNamespace.bat is because some tests were taking calls for http://+:50231/ instead of http://localhost:50231/, and this behavior happened only when using HttpSelfHost. Configuring our tests not to take the broader URL space means they don't ever need admin-level access.
-rw-r--r--test/System.Web.Http.Integration.Test/ContentNegotiation/CustomFormatterTests.cs6
-rw-r--r--test/System.Web.Http.Integration.Test/ContentNegotiation/HttpResponseReturnTests.cs2
-rw-r--r--test/System.Web.Http.Integration.Test/ModelBinding/HttpContentBindingTests.cs2
-rw-r--r--test/System.Web.Http.SelfHost.Test/Authentication/BasicOverHttpTest.cs2
-rw-r--r--test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs2
-rw-r--r--test/System.Web.Http.SelfHost.Test/HttpSelfHostResponseTest.cs2
-rw-r--r--test/System.Web.Http.SelfHost.Test/HttpSelfHostServerTest.cs1
-rw-r--r--tools/TestHttpNamespace.bat27
8 files changed, 16 insertions, 28 deletions
diff --git a/test/System.Web.Http.Integration.Test/ContentNegotiation/CustomFormatterTests.cs b/test/System.Web.Http.Integration.Test/ContentNegotiation/CustomFormatterTests.cs
index 6e9875fe..0f507178 100644
--- a/test/System.Web.Http.Integration.Test/ContentNegotiation/CustomFormatterTests.cs
+++ b/test/System.Web.Http.Integration.Test/ContentNegotiation/CustomFormatterTests.cs
@@ -7,6 +7,7 @@ using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
+using System.ServiceModel;
using System.Threading.Tasks;
using System.Web.Http.SelfHost;
using System.Web.Http.Util;
@@ -111,7 +112,10 @@ namespace System.Web.Http.ContentNegotiation
private void SetupHost()
{
baseAddress = "http://localhost/";
- config = new HttpSelfHostConfiguration(baseAddress);
+ config = new HttpSelfHostConfiguration(baseAddress)
+ {
+ HostNameComparisonMode = HostNameComparisonMode.Exact
+ };
config.Routes.MapHttpRoute("Default", "{controller}/{action}", new { controller = "CustomFormatterTests", action = "EchoOrder" });
config.MessageHandlers.Add(new ConvertToStreamMessageHandler());
config.Formatters.Add(new PlainTextFormatterWithVersionInfo());
diff --git a/test/System.Web.Http.Integration.Test/ContentNegotiation/HttpResponseReturnTests.cs b/test/System.Web.Http.Integration.Test/ContentNegotiation/HttpResponseReturnTests.cs
index 6afe1854..14fc1ae9 100644
--- a/test/System.Web.Http.Integration.Test/ContentNegotiation/HttpResponseReturnTests.cs
+++ b/test/System.Web.Http.Integration.Test/ContentNegotiation/HttpResponseReturnTests.cs
@@ -5,6 +5,7 @@ using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
+using System.ServiceModel;
using System.Web.Http.SelfHost;
using System.Web.Http.Util;
using Microsoft.TestCommon;
@@ -80,6 +81,7 @@ namespace System.Web.Http.ContentNegotiation
baseAddress = "http://localhost/";
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(baseAddress);
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}/{action}", new { controller = "HttpResponseReturn" });
config.MessageHandlers.Add(new ConvertToStreamMessageHandler());
diff --git a/test/System.Web.Http.Integration.Test/ModelBinding/HttpContentBindingTests.cs b/test/System.Web.Http.Integration.Test/ModelBinding/HttpContentBindingTests.cs
index 89e334a3..bfff7d29 100644
--- a/test/System.Web.Http.Integration.Test/ModelBinding/HttpContentBindingTests.cs
+++ b/test/System.Web.Http.Integration.Test/ModelBinding/HttpContentBindingTests.cs
@@ -4,6 +4,7 @@ using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
+using System.ServiceModel;
using System.Web.Http.SelfHost;
using System.Web.Http.Util;
using Microsoft.TestCommon;
@@ -52,6 +53,7 @@ namespace System.Web.Http.ModelBinding
baseAddress = "http://localhost/";
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(baseAddress);
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}/{action}", new { controller = "HttpContentBinding", action = "HandleMessage" });
config.MessageHandlers.Add(new ConvertToStreamMessageHandler());
diff --git a/test/System.Web.Http.SelfHost.Test/Authentication/BasicOverHttpTest.cs b/test/System.Web.Http.SelfHost.Test/Authentication/BasicOverHttpTest.cs
index 66475909..6d14212e 100644
--- a/test/System.Web.Http.SelfHost.Test/Authentication/BasicOverHttpTest.cs
+++ b/test/System.Web.Http.SelfHost.Test/Authentication/BasicOverHttpTest.cs
@@ -2,6 +2,7 @@
using System.Net;
using System.Net.Http;
+using System.ServiceModel;
using System.Web.Http.SelfHost;
using Microsoft.TestCommon;
@@ -39,6 +40,7 @@ namespace System.Web.Http
{
// Arrange
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(BaseAddress);
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}" + routeSuffix, new { controller = controllerName });
config.UserNamePasswordValidator = new CustomUsernamePasswordValidator();
config.MessageHandlers.Add(new CustomMessageHandler());
diff --git a/test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs b/test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs
index 62e2191c..a6ac02ab 100644
--- a/test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs
+++ b/test/System.Web.Http.SelfHost.Test/DeeplyNestedTypeTests.cs
@@ -4,6 +4,7 @@ using System.IO;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
+using System.ServiceModel;
using System.Text;
using System.Xml.Linq;
using Microsoft.TestCommon;
@@ -27,6 +28,7 @@ namespace System.Web.Http.SelfHost
baseAddress = String.Format("http://localhost/");
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(baseAddress);
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}/{action}", new { controller = "DeepNestedType" });
server = new HttpSelfHostServer(config);
diff --git a/test/System.Web.Http.SelfHost.Test/HttpSelfHostResponseTest.cs b/test/System.Web.Http.SelfHost.Test/HttpSelfHostResponseTest.cs
index 1cf94d2b..98ebfb67 100644
--- a/test/System.Web.Http.SelfHost.Test/HttpSelfHostResponseTest.cs
+++ b/test/System.Web.Http.SelfHost.Test/HttpSelfHostResponseTest.cs
@@ -5,6 +5,7 @@ using System.Net;
using System.Net.Http;
using System.Net.Http.Formatting;
using System.Net.Http.Headers;
+using System.ServiceModel;
using System.Threading.Tasks;
using Microsoft.TestCommon;
@@ -27,6 +28,7 @@ namespace System.Web.Http.SelfHost
baseAddress = String.Format("http://localhost:{0}/", HttpSelfHostServerTest.TestPort);
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(baseAddress);
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}/{action}", new { controller = "NullResponse" });
messageHandler = new NullResponseMessageHandler();
diff --git a/test/System.Web.Http.SelfHost.Test/HttpSelfHostServerTest.cs b/test/System.Web.Http.SelfHost.Test/HttpSelfHostServerTest.cs
index 095a93cb..ead46f52 100644
--- a/test/System.Web.Http.SelfHost.Test/HttpSelfHostServerTest.cs
+++ b/test/System.Web.Http.SelfHost.Test/HttpSelfHostServerTest.cs
@@ -242,6 +242,7 @@ namespace System.Web.Http.SelfHost
private static HttpSelfHostServer CreateServer(TransferMode transferMode)
{
HttpSelfHostConfiguration config = new HttpSelfHostConfiguration(BaseUri(transferMode));
+ config.HostNameComparisonMode = HostNameComparisonMode.Exact;
config.Routes.MapHttpRoute("Default", "{controller}/{action}");
config.TransferMode = transferMode;
diff --git a/tools/TestHttpNamespace.bat b/tools/TestHttpNamespace.bat
deleted file mode 100644
index 7aea4091..00000000
--- a/tools/TestHttpNamespace.bat
+++ /dev/null
@@ -1,27 +0,0 @@
-@ECHO OFF
-:CHECKFORSWITCHES
-IF '%1'=='/h' GOTO DISPINFO
-IF '%1'=='/H' GOTO DISPINFO
-IF '%1'=='/?' GOTO DISPINFO
-IF '%1'=='/register' GOTO REGISTER
-IF '%1'=='/unregister' GOTO UNREGISTER
-IF '%1'=='/REGISTER' GOTO REGISTER
-IF '%1'=='/UNREGISTER' GOTO UNREGISTER
-
-GOTO DISPINFO
-
-:REGISTER
-netsh http add urlacl http://+:50231/ user=%USERDOMAIN%\%USERNAME%
-GOTO END
-
-:UNREGISTER
-netsh http delete urlacl http://+:50231/
-GOTO END
-
-:DISPINFO
-ECHO Reserve/Unreserve http.sys url's used by aspnetwebstack unit tests
-ECHO.
-ECHO Syntax: TestHttpNamespace [/register] [/unregister] [/h]
-GOTO END
-
-:END