From f12117fe1fdaaa22a2f9f9806b5a9b3955d1c49e Mon Sep 17 00:00:00 2001 From: Chris Ross Date: Tue, 15 Apr 2014 11:28:42 -0700 Subject: [PATCH] Remove temp IAppBuilder support. --- HttpAbstractions.sln | 15 +- .../AppBuilderSupportExtensions.cs | 40 -- .../ICanHasOwinEnvironment.cs | 9 - .../Microsoft.AspNet.AppBuilderSupport.kproj | 33 -- .../OwinConstants.cs | 175 --------- .../OwinHttpEnvironment.cs | 364 ------------------ .../project.json | 16 - .../AppBuilderSupportTests.cs | 43 --- ...osoft.AspNet.AppBuilderSupport.Tests.kproj | 30 -- .../OwinHttpEnvironmentTests.cs | 50 --- .../project.json | 30 -- 11 files changed, 1 insertion(+), 804 deletions(-) delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/AppBuilderSupportExtensions.cs delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/ICanHasOwinEnvironment.cs delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/Microsoft.AspNet.AppBuilderSupport.kproj delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/OwinConstants.cs delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/OwinHttpEnvironment.cs delete mode 100644 src/Microsoft.AspNet.AppBuilderSupport/project.json delete mode 100644 test/Microsoft.AspNet.AppBuilderSupport.Tests/AppBuilderSupportTests.cs delete mode 100644 test/Microsoft.AspNet.AppBuilderSupport.Tests/Microsoft.AspNet.AppBuilderSupport.Tests.kproj delete mode 100644 test/Microsoft.AspNet.AppBuilderSupport.Tests/OwinHttpEnvironmentTests.cs delete mode 100644 test/Microsoft.AspNet.AppBuilderSupport.Tests/project.json diff --git a/HttpAbstractions.sln b/HttpAbstractions.sln index 287f3868d2..4629030603 100644 --- a/HttpAbstractions.sln +++ b/HttpAbstractions.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30410.0 +VisualStudioVersion = 12.0.30401.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{A5A15F1C-885A-452A-A731-B0173DDBD913}" EndProject @@ -17,8 +17,6 @@ Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FeatureMod EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.PipelineCore.Tests", "test\Microsoft.AspNet.PipelineCore.Tests\Microsoft.AspNet.PipelineCore.Tests.kproj", "{AA99AF26-F7B1-4A6B-A922-5C25539F6391}" EndProject -Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.AppBuilderSupport", "src\Microsoft.AspNet.AppBuilderSupport\Microsoft.AspNet.AppBuilderSupport.kproj", "{65C93D2B-CBD1-4E51-9312-10C1965A7241}" -EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.FeatureModel.Tests", "test\Microsoft.AspNet.FeatureModel.Tests\Microsoft.AspNet.FeatureModel.Tests.kproj", "{C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}" EndProject Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Microsoft.AspNet.Abstractions.Tests", "test\Microsoft.AspNet.Abstractions.Tests\Microsoft.AspNet.Abstractions.Tests.kproj", "{F16692B8-9F38-4DCA-A582-E43172B989C6}" @@ -85,16 +83,6 @@ Global {AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|Mixed Platforms.Build.0 = Release|x86 {AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|x86.ActiveCfg = Release|x86 {AA99AF26-F7B1-4A6B-A922-5C25539F6391}.Release|x86.Build.0 = Release|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Debug|Any CPU.ActiveCfg = Debug|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Debug|Mixed Platforms.Build.0 = Debug|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Debug|x86.ActiveCfg = Debug|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Debug|x86.Build.0 = Debug|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Release|Any CPU.ActiveCfg = Release|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Release|Mixed Platforms.ActiveCfg = Release|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Release|Mixed Platforms.Build.0 = Release|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Release|x86.ActiveCfg = Release|x86 - {65C93D2B-CBD1-4E51-9312-10C1965A7241}.Release|x86.Build.0 = Release|x86 {C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Any CPU.ActiveCfg = Debug|x86 {C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.ActiveCfg = Debug|x86 {C5D2BAE1-E182-48A0-AA74-1AF14B782BF7}.Debug|Mixed Platforms.Build.0 = Debug|x86 @@ -135,7 +123,6 @@ Global {D9128247-8F97-48B8-A863-F1F21A029FCE} = {A5A15F1C-885A-452A-A731-B0173DDBD913} {32A4C918-30EE-41DB-8E26-8A3BB88ED231} = {A5A15F1C-885A-452A-A731-B0173DDBD913} {AA99AF26-F7B1-4A6B-A922-5C25539F6391} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} - {65C93D2B-CBD1-4E51-9312-10C1965A7241} = {A5A15F1C-885A-452A-A731-B0173DDBD913} {C5D2BAE1-E182-48A0-AA74-1AF14B782BF7} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} {F16692B8-9F38-4DCA-A582-E43172B989C6} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} {83D44696-C790-4356-9187-79F89010ED4F} = {F31FF137-390C-49BF-A3BD-7C6ED3597C21} diff --git a/src/Microsoft.AspNet.AppBuilderSupport/AppBuilderSupportExtensions.cs b/src/Microsoft.AspNet.AppBuilderSupport/AppBuilderSupportExtensions.cs deleted file mode 100644 index 215afb8bcf..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/AppBuilderSupportExtensions.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Microsoft.AspNet.Abstractions; -using Microsoft.AspNet.PipelineCore; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNet.FeatureModel; -using Microsoft.AspNet.PipelineCore.Owin; - -namespace Owin -{ - using AppFunc = Func, Task>; - - public static class AppBuilderSupportExtensions - { - public static IAppBuilder UseBuilder(this IAppBuilder appBuilder, Action configuration) - { - IBuilder builder = new Builder(null); - configuration(builder); - Func middleware1 = next1 => { - Func middleware2 = next2 => { - return httpContext => { - return next1(httpContext.GetFeature().Environment); - }; - }; - builder.Use(middleware2); - var app = builder.Build(); - return env => - { - return app.Invoke( - new DefaultHttpContext( - new FeatureCollection( - new OwinHttpEnvironment(env)))); - }; - }; - return appBuilder.Use(middleware1); - } - } -} diff --git a/src/Microsoft.AspNet.AppBuilderSupport/ICanHasOwinEnvironment.cs b/src/Microsoft.AspNet.AppBuilderSupport/ICanHasOwinEnvironment.cs deleted file mode 100644 index 37632116bd..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/ICanHasOwinEnvironment.cs +++ /dev/null @@ -1,9 +0,0 @@ -using System.Collections.Generic; - -namespace Microsoft.AspNet.PipelineCore.Owin -{ - public interface ICanHasOwinEnvironment - { - IDictionary Environment { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.AppBuilderSupport/Microsoft.AspNet.AppBuilderSupport.kproj b/src/Microsoft.AspNet.AppBuilderSupport/Microsoft.AspNet.AppBuilderSupport.kproj deleted file mode 100644 index ad85762a01..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/Microsoft.AspNet.AppBuilderSupport.kproj +++ /dev/null @@ -1,33 +0,0 @@ - - - - 12.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 65c93d2b-cbd1-4e51-9312-10c1965a7241 - Library - net45 - - - - - - - 2.0 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/Microsoft.AspNet.AppBuilderSupport/OwinConstants.cs b/src/Microsoft.AspNet.AppBuilderSupport/OwinConstants.cs deleted file mode 100644 index 45aabf2913..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/OwinConstants.cs +++ /dev/null @@ -1,175 +0,0 @@ -namespace Microsoft.AspNet.PipelineCore.Owin -{ - internal static class OwinConstants - { - #region OWIN v1.0.0 - 3.2.1. Request Data - - // http://owin.org/spec/owin-1.0.0.html - - public const string RequestScheme = "owin.RequestScheme"; - public const string RequestMethod = "owin.RequestMethod"; - public const string RequestPathBase = "owin.RequestPathBase"; - public const string RequestPath = "owin.RequestPath"; - public const string RequestQueryString = "owin.RequestQueryString"; - public const string RequestProtocol = "owin.RequestProtocol"; - public const string RequestHeaders = "owin.RequestHeaders"; - public const string RequestBody = "owin.RequestBody"; - - #endregion - - #region OWIN v1.0.0 - 3.2.2. Response Data - - // http://owin.org/spec/owin-1.0.0.html - - public const string ResponseStatusCode = "owin.ResponseStatusCode"; - public const string ResponseReasonPhrase = "owin.ResponseReasonPhrase"; - public const string ResponseProtocol = "owin.ResponseProtocol"; - public const string ResponseHeaders = "owin.ResponseHeaders"; - public const string ResponseBody = "owin.ResponseBody"; - - #endregion - - #region OWIN v1.0.0 - 3.2.3. Other Data - - // http://owin.org/spec/owin-1.0.0.html - - public const string CallCancelled = "owin.CallCancelled"; - - public const string OwinVersion = "owin.Version"; - - #endregion - - #region OWIN Keys for IAppBuilder.Properties - - internal static class Builder - { - public const string AddSignatureConversion = "builder.AddSignatureConversion"; - public const string DefaultApp = "builder.DefaultApp"; - } - - #endregion - - #region OWIN Key Guidelines and Common Keys - 6. Common keys - - // http://owin.org/spec/CommonKeys.html - - internal static class CommonKeys - { - public const string ClientCertificate = "ssl.ClientCertificate"; - public const string LoadClientCertAsync = "ssl.LoadClientCertAsync"; - public const string RemoteIpAddress = "server.RemoteIpAddress"; - public const string RemotePort = "server.RemotePort"; - public const string LocalIpAddress = "server.LocalIpAddress"; - public const string LocalPort = "server.LocalPort"; - public const string IsLocal = "server.IsLocal"; - public const string TraceOutput = "host.TraceOutput"; - public const string Addresses = "host.Addresses"; - public const string AppName = "host.AppName"; - public const string Capabilities = "server.Capabilities"; - public const string OnSendingHeaders = "server.OnSendingHeaders"; - public const string OnAppDisposing = "host.OnAppDisposing"; - public const string Scheme = "scheme"; - public const string Host = "host"; - public const string Port = "port"; - public const string Path = "path"; - } - - #endregion - - #region SendFiles v0.3.0 - - // http://owin.org/extensions/owin-SendFile-Extension-v0.3.0.htm - - internal static class SendFiles - { - // 3.1. Startup - - public const string Version = "sendfile.Version"; - public const string Support = "sendfile.Support"; - public const string Concurrency = "sendfile.Concurrency"; - - // 3.2. Per Request - - public const string SendAsync = "sendfile.SendAsync"; - } - - #endregion - - #region Opaque v0.3.0 - - // http://owin.org/extensions/owin-OpaqueStream-Extension-v0.3.0.htm - - internal static class OpaqueConstants - { - // 3.1. Startup - - public const string Version = "opaque.Version"; - - // 3.2. Per Request - - public const string Upgrade = "opaque.Upgrade"; - - // 5. Consumption - - public const string Stream = "opaque.Stream"; - // public const string Version = "opaque.Version"; // redundant, declared above - public const string CallCancelled = "opaque.CallCancelled"; - } - - #endregion - - #region WebSocket v0.4.0 - - // http://owin.org/extensions/owin-OpaqueStream-Extension-v0.3.0.htm - - internal static class WebSocket - { - // 3.1. Startup - - public const string Version = "websocket.Version"; - - // 3.2. Per Request - - public const string Accept = "websocket.Accept"; - - // 4. Accept - - public const string SubProtocol = "websocket.SubProtocol"; - - // 5. Consumption - - public const string SendAsync = "websocket.SendAsync"; - public const string ReceiveAsync = "websocket.ReceiveAsync"; - public const string CloseAsync = "websocket.CloseAsync"; - // public const string Version = "websocket.Version"; // redundant, declared above - public const string CallCancelled = "websocket.CallCancelled"; - public const string ClientCloseStatus = "websocket.ClientCloseStatus"; - public const string ClientCloseDescription = "websocket.ClientCloseDescription"; - } - - #endregion - - #region Security v0.1.0 - - // http://owin.org/extensions/owin-Security-Extension-v0.1.0.htm - - internal static class Security - { - // 3.2. Per Request - - public const string User = "server.User"; - - public const string Authenticate = "security.Authenticate"; - - // 3.3. Response - - public const string SignIn = "security.SignIn"; - - public const string SignOut = "security.SignOut"; - - public const string Challenge = "security.Challenge"; - } - - #endregion - } -} diff --git a/src/Microsoft.AspNet.AppBuilderSupport/OwinHttpEnvironment.cs b/src/Microsoft.AspNet.AppBuilderSupport/OwinHttpEnvironment.cs deleted file mode 100644 index 02be7db4a5..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/OwinHttpEnvironment.cs +++ /dev/null @@ -1,364 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Globalization; -using System.IO; -using System.Linq; -using System.Net; -using System.Reflection; -#if NET45 -using System.Security.Cryptography.X509Certificates; -#endif -using System.Threading; -using System.Threading.Tasks; -using Microsoft.AspNet.HttpFeature; -using Microsoft.AspNet.FeatureModel; - -namespace Microsoft.AspNet.PipelineCore.Owin -{ - using SendFileFunc = Func; - - public class OwinHttpEnvironment : - IFeatureCollection, - IHttpRequestInformation, - IHttpResponseInformation, - IHttpConnection, - IHttpSendFile, - IHttpTransportLayerSecurity, - ICanHasOwinEnvironment - { - public IDictionary Environment { get; set; } - - public OwinHttpEnvironment(IDictionary environment) - { - Environment = environment; - } - - T Prop(string key) - { - object value; - if (Environment.TryGetValue(key, out value) && value is T) - { - return (T)value; - } - return default(T); - } - - void Prop(string key, object value) - { - Environment[key] = value; - } - - string IHttpRequestInformation.Protocol - { - get { return Prop("owin.RequestProtocol"); } - set { Prop("owin.RequestProtocol", value); } - } - - string IHttpRequestInformation.Scheme - { - get { return Prop("owin.RequestScheme"); } - set { Prop("owin.RequestScheme", value); } - } - - string IHttpRequestInformation.Method - { - get { return Prop("owin.RequestMethod"); } - set { Prop("owin.RequestMethod", value); } - } - - string IHttpRequestInformation.PathBase - { - get { return Prop("owin.RequestPathBase"); } - set { Prop("owin.RequestPathBase", value); } - } - - string IHttpRequestInformation.Path - { - get { return Prop("owin.RequestPath"); } - set { Prop("owin.RequestPath", value); } - } - - string IHttpRequestInformation.QueryString - { - get { return Prop("owin.RequestQueryString"); } - set { Prop("owin.RequestQueryString", value); } - } - - IDictionary IHttpRequestInformation.Headers - { - get { return Prop>("owin.RequestHeaders"); } - set { Prop("owin.RequestHeaders", value); } - } - - Stream IHttpRequestInformation.Body - { - get { return Prop("owin.RequestBody"); } - set { Prop("owin.RequestBody", value); } - } - - int IHttpResponseInformation.StatusCode - { - get { return Prop("owin.ResponseStatusCode"); } - set { Prop("owin.ResponseStatusCode", value); } - } - - string IHttpResponseInformation.ReasonPhrase - { - get { return Prop("owin.ResponseReasonPhrase"); } - set { Prop("owin.ResponseReasonPhrase", value); } - } - - IDictionary IHttpResponseInformation.Headers - { - get { return Prop>("owin.ResponseHeaders"); } - set { Prop("owin.ResponseHeaders", value); } - } - - Stream IHttpResponseInformation.Body - { - get { return Prop("owin.ResponseBody"); } - set { Prop("owin.ResponseBody", value); } - } - - void IHttpResponseInformation.OnSendingHeaders(Action callback, object state) - { - // TODO: - } -#if NET45 - IPAddress IHttpConnection.RemoteIpAddress - { - get { return IPAddress.Parse(Prop(OwinConstants.CommonKeys.RemoteIpAddress)); } - set { Prop(OwinConstants.CommonKeys.RemoteIpAddress, value.ToString()); } - } - - IPAddress IHttpConnection.LocalIpAddress - { - get { return IPAddress.Parse(Prop(OwinConstants.CommonKeys.LocalIpAddress)); } - set { Prop(OwinConstants.CommonKeys.LocalIpAddress, value.ToString()); } - } -#endif - int IHttpConnection.RemotePort - { - get { return int.Parse(Prop(OwinConstants.CommonKeys.RemotePort)); } - set { Prop(OwinConstants.CommonKeys.RemotePort, value.ToString(CultureInfo.InvariantCulture)); } - } - - int IHttpConnection.LocalPort - { - get { return int.Parse(Prop(OwinConstants.CommonKeys.LocalPort)); } - set { Prop(OwinConstants.CommonKeys.LocalPort, value.ToString(CultureInfo.InvariantCulture)); } - } - - bool IHttpConnection.IsLocal - { - get { return Prop(OwinConstants.CommonKeys.IsLocal); } - set { Prop(OwinConstants.CommonKeys.LocalPort, value); } - } - - private bool SupportsSendFile - { - get - { - object obj; - return Environment.TryGetValue(OwinConstants.SendFiles.SendAsync, out obj) && obj != null; - } - } - - Task IHttpSendFile.SendFileAsync(string path, long offset, long? length, CancellationToken cancellation) - { - object obj; - if (Environment.TryGetValue(OwinConstants.SendFiles.SendAsync, out obj)) - { - var func = (SendFileFunc)obj; - return func(path, offset, length, cancellation); - } - throw new NotSupportedException(OwinConstants.SendFiles.SendAsync); - } - - private bool SupportsClientCerts - { - get - { - object obj; - if (string.Equals("https", ((IHttpRequestInformation)this).Scheme, StringComparison.OrdinalIgnoreCase) - && (Environment.TryGetValue(OwinConstants.CommonKeys.LoadClientCertAsync, out obj) - || Environment.TryGetValue(OwinConstants.CommonKeys.ClientCertificate, out obj)) - && obj != null) - { - return true; - } - return false; - } - } -#if NET45 - X509Certificate IHttpTransportLayerSecurity.ClientCertificate - { - get { return Prop(OwinConstants.CommonKeys.ClientCertificate); } - set { Prop(OwinConstants.CommonKeys.ClientCertificate, value); } - } -#endif - Task IHttpTransportLayerSecurity.LoadAsync() - { - throw new NotImplementedException(); - } - - public int Revision - { - get { return 0; } // Not modifiable - } - - public void Add(Type key, object value) - { - throw new NotSupportedException(); - } - - public bool ContainsKey(Type key) - { - // Does this type implement the requested interface? - if (key.GetTypeInfo().IsAssignableFrom(this.GetType().GetTypeInfo())) - { - // Check for conditional features - if (key == typeof(IHttpSendFile)) - { - return SupportsSendFile; - } - else if (key == typeof(IHttpTransportLayerSecurity)) - { - return SupportsClientCerts; - } - - // The rest of the features are always supported. - return true; - } - return false; - } - - public ICollection Keys - { - get - { - var keys = new List() - { - typeof(IHttpRequestInformation), - typeof(IHttpResponseInformation), - typeof(IHttpConnection), - typeof(ICanHasOwinEnvironment), - }; - if (SupportsSendFile) - { - keys.Add(typeof(IHttpSendFile)); - } - if (SupportsClientCerts) - { - keys.Add(typeof(IHttpTransportLayerSecurity)); - } - return keys; - } - } - - public bool Remove(Type key) - { - throw new NotSupportedException(); - } - - public bool TryGetValue(Type key, out object value) - { - if (ContainsKey(key)) - { - value = this; - return true; - } - value = null; - return false; - } - - public ICollection Values - { - get { throw new NotSupportedException(); } - } - - public object this[Type key] - { - get - { - object value; - if (TryGetValue(key, out value)) - { - return value; - } - throw new KeyNotFoundException(key.FullName); - } - set - { - throw new NotSupportedException(); - } - } - - public void Add(KeyValuePair item) - { - throw new NotSupportedException(); - } - - public void Clear() - { - throw new NotSupportedException(); - } - - public bool Contains(KeyValuePair item) - { - object result; - return TryGetValue(item.Key, out result) && result.Equals(item.Value); - } - - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - if (array == null) - { - throw new ArgumentNullException("array"); - } - if (arrayIndex < 0 || arrayIndex > array.Length) - { - throw new ArgumentOutOfRangeException("arrayIndex", arrayIndex, string.Empty); - } - var keys = Keys; - if (keys.Count > array.Length - arrayIndex) - { - throw new ArgumentException(); - } - - foreach (var key in keys) - { - array[arrayIndex++] = new KeyValuePair(key, this[key]); - } - } - - public int Count - { - get { return Keys.Count; } - } - - public bool IsReadOnly - { - get { return true; } - } - - public bool Remove(KeyValuePair item) - { - throw new NotSupportedException(); - } - - public IEnumerator> GetEnumerator() - { - return Keys.Select(type => new KeyValuePair(type, this[type])).GetEnumerator(); - } - - System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() - { - return GetEnumerator(); - } - - public void Dispose() - { - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNet.AppBuilderSupport/project.json b/src/Microsoft.AspNet.AppBuilderSupport/project.json deleted file mode 100644 index c597c1a29a..0000000000 --- a/src/Microsoft.AspNet.AppBuilderSupport/project.json +++ /dev/null @@ -1,16 +0,0 @@ -{ - "version": "0.1-alpha-*", - "dependencies": { - "Microsoft.AspNet.Abstractions": "0.1-alpha-*", - "Microsoft.AspNet.FeatureModel": "0.1-alpha-*", - "Microsoft.AspNet.PipelineCore": "0.1-alpha-*", - "Microsoft.AspNet.HttpFeature" : "" - }, - "configurations": { - "net45": { - "dependencies": { - "Owin": "1.0" - } - } - } -} \ No newline at end of file diff --git a/test/Microsoft.AspNet.AppBuilderSupport.Tests/AppBuilderSupportTests.cs b/test/Microsoft.AspNet.AppBuilderSupport.Tests/AppBuilderSupportTests.cs deleted file mode 100644 index 4b2c70872d..0000000000 --- a/test/Microsoft.AspNet.AppBuilderSupport.Tests/AppBuilderSupportTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Net; -using System.Runtime.Remoting.Contexts; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNet.Abstractions; -using Owin; -using Xunit; - -namespace Microsoft.AspNet.AppBuilderSupport.Tests -{ - public class AppBuilderSupportTests - { - [Fact] - public async Task BuildCanGoInsideAppBuilder() - { - var server = Microsoft.Owin.Testing.TestServer.Create( - app => app.UseBuilder(HelloWorld)); - - var result = await server.CreateRequest("/hello").GetAsync(); - var body = await result.Content.ReadAsStringAsync(); - - Assert.Equal(result.StatusCode, HttpStatusCode.Accepted); - Assert.Equal(body, "Hello world!"); - } - - private void HelloWorld(IBuilder builder) - { - builder.Use(next => async context => - { - await next(context); - }); - builder.Run(async context => - { - context.Response.StatusCode = 202; - await context.Response.WriteAsync("Hello world!"); - }); - } - } -} diff --git a/test/Microsoft.AspNet.AppBuilderSupport.Tests/Microsoft.AspNet.AppBuilderSupport.Tests.kproj b/test/Microsoft.AspNet.AppBuilderSupport.Tests/Microsoft.AspNet.AppBuilderSupport.Tests.kproj deleted file mode 100644 index 3c166c3380..0000000000 --- a/test/Microsoft.AspNet.AppBuilderSupport.Tests/Microsoft.AspNet.AppBuilderSupport.Tests.kproj +++ /dev/null @@ -1,30 +0,0 @@ - - - - 12.0 - $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) - - - - 83d44696-c790-4356-9187-79f89010ed4f - Library - - - - - - - 2.0 - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNet.AppBuilderSupport.Tests/OwinHttpEnvironmentTests.cs b/test/Microsoft.AspNet.AppBuilderSupport.Tests/OwinHttpEnvironmentTests.cs deleted file mode 100644 index 5b639a6a0c..0000000000 --- a/test/Microsoft.AspNet.AppBuilderSupport.Tests/OwinHttpEnvironmentTests.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using Microsoft.AspNet.FeatureModel; -using Microsoft.AspNet.HttpFeature; -using Microsoft.AspNet.PipelineCore.Owin; -using Xunit; - -namespace Microsoft.AspNet.AppBuilderSupport.Tests -{ - public class OwinHttpEnvironmentTests - { - private T Get(IFeatureCollection features) - { - object value; - return features.TryGetValue(typeof(T), out value) ? (T)value : default(T); - } - - [Fact] - public void OwinHttpEnvironmentCanBeCreated() - { - var env = new Dictionary - { - {"owin.RequestMethod", "POST"} - }; - var features = new FeatureObject( new OwinHttpEnvironment(env)); - - Assert.Equal(Get(features).Method, "POST"); - } - - [Fact] - public void ImplementedInterfacesAreEnumerated() - { - var env = new Dictionary - { - {"owin.RequestMethod", "POST"} - }; - var features = new FeatureObject(new OwinHttpEnvironment(env)); - - var entries = features.ToArray(); - var keys = features.Keys.ToArray(); - var values = features.Values.ToArray(); - - Assert.Contains(typeof(IHttpRequestInformation), keys); - Assert.Contains(typeof(IHttpResponseInformation), keys); - } - } -} diff --git a/test/Microsoft.AspNet.AppBuilderSupport.Tests/project.json b/test/Microsoft.AspNet.AppBuilderSupport.Tests/project.json deleted file mode 100644 index a0a22125e6..0000000000 --- a/test/Microsoft.AspNet.AppBuilderSupport.Tests/project.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "version": "0.1-alpha-*", - "dependencies": { - "Microsoft.AspNet.AppBuilderSupport": "", - "Microsoft.AspNet.HttpFeature": "", - "Microsoft.AspNet.Abstractions": "", - "Microsoft.AspNet.FeatureModel": "", - "Xunit.KRunner": "0.1-alpha-*", - "xunit.abstractions": "2.0.0-aspnet-*", - "xunit.assert": "2.0.0-aspnet-*", - "xunit.core": "2.0.0-aspnet-*", - "xunit.execution": "2.0.0-aspnet-*" - }, - "commands": { - "test": "Xunit.KRunner" - }, - "configurations": { - "net45": { - "dependencies": { - "System.Runtime": "", - "Owin": "1.0", - "Microsoft.Owin": "2.1.0", - "Microsoft.Owin.Hosting": "2.1.0", - "Microsoft.Owin.Testing": "2.1.0", - "Shouldly": "1.1.1.1", - "System.Net.Http": "" - } - } - } -} \ No newline at end of file