Permalink
Browse files

Empty projects to contain Manos http handler

Another managed-code web server
  • Loading branch information...
1 parent 1733cac commit d7654f19fd644ad3a854b76bba32ec032c59493e @loudej loudej committed Dec 26, 2011
View
@@ -49,6 +49,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gate.HttpListener", "src\Ho
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gate.HttpListener.Tests", "src\Tests\Gate.HttpListener.Tests\Gate.HttpListener.Tests.csproj", "{6BD54361-C499-4F93-A8FE-015FFE0DBF6F}"
EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gate.Hosts.Manos", "src\Hosts\Gate.Hosts.Manos\Gate.Hosts.Manos.csproj", "{A3C2FFB6-663E-4C94-884A-41ADB22DB724}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Gate.Hosts.Manos.Tests", "src\Tests\Gate.Hosts.Manos.Tests\Gate.Hosts.Manos.Tests.csproj", "{F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}"
+EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -269,6 +273,26 @@ Global
{6BD54361-C499-4F93-A8FE-015FFE0DBF6F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{6BD54361-C499-4F93-A8FE-015FFE0DBF6F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{6BD54361-C499-4F93-A8FE-015FFE0DBF6F}.Release|x86.ActiveCfg = Release|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Release|Any CPU.Build.0 = Release|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724}.Release|x86.ActiveCfg = Release|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}.Release|x86.ActiveCfg = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -281,10 +305,12 @@ Global
{8AA0A98F-FCE3-4DEB-88A2-67B5C8F9845B} = {04624DF3-D446-482F-9EE7-44CB5E64B194}
{AFFF8587-C837-433F-913A-BF34B0885243} = {04624DF3-D446-482F-9EE7-44CB5E64B194}
{6BD54361-C499-4F93-A8FE-015FFE0DBF6F} = {04624DF3-D446-482F-9EE7-44CB5E64B194}
+ {F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E} = {04624DF3-D446-482F-9EE7-44CB5E64B194}
{F32E456A-F26E-4C5D-93B8-311941A714E4} = {26168DEC-6A14-498B-89F4-34881B625D60}
{E7602355-82C2-4698-AB61-128B8A6E53CE} = {26168DEC-6A14-498B-89F4-34881B625D60}
{D96E8CF9-C2A5-4A35-814C-0B4FE9828B26} = {26168DEC-6A14-498B-89F4-34881B625D60}
{A1A94BF6-7E05-430E-947D-B046A2A00CAF} = {26168DEC-6A14-498B-89F4-34881B625D60}
+ {A3C2FFB6-663E-4C94-884A-41ADB22DB724} = {26168DEC-6A14-498B-89F4-34881B625D60}
{0D16BD06-1972-4714-9D79-7E84F82748F4} = {C84C3CDC-FC22-4AF2-8759-4B407BF5AD56}
{25EC3795-B2D8-4588-8139-8BD428269DB1} = {C84C3CDC-FC22-4AF2-8759-4B407BF5AD56}
{0E89EFE3-63CE-4222-9C0B-DD1F5559DAAF} = {C84C3CDC-FC22-4AF2-8759-4B407BF5AD56}
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{A3C2FFB6-663E-4C94-884A-41ADB22DB724}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Gate.Hosts.Manos</RootNamespace>
+ <AssemblyName>Gate.Hosts.Manos</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\Gate\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="Manos">
+ <HintPath>..\..\..\dependencies\Manos.0.1.4-SNAPSHOT\lib\net40\Manos.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Configuration" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="Server.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Main\Gate.Builder\Gate.Builder.csproj">
+ <Project>{D26293A2-8533-4BF6-A9CC-A88455B0FF71}</Project>
+ <Name>Gate.Builder</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Main\Gate.Owin\Gate.Owin.csproj">
+ <Project>{B60C657C-80DA-4AA3-8796-AD920D5EB5A0}</Project>
+ <Name>Gate.Owin</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,32 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Gate.Hosts.Manos")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("5b1622f6-c2f8-4813-8cc7-c31d162714d8")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,59 @@
+using System;
+using System.Configuration;
+using Gate.Builder;
+using Gate.Owin;
+
+namespace Gate.Hosts.Manos
+{
+ public static class Server
+ {
+ public static IDisposable Create(int port)
+ {
+ return Create(port, "");
+ }
+
+ public static IDisposable Create(int port, string path)
+ {
+ return Create(ConfigurationManager.AppSettings["Gate.Startup"], port, path);
+ }
+
+ public static IDisposable Create(string startupName, int port)
+ {
+ return Create(startupName, port, "");
+ }
+
+ public static IDisposable Create(string startupName, int port, string path)
+ {
+ AppDelegate app = AppBuilder.BuildConfiguration(startupName);
+ return Create(app, port, path);
+ }
+
+ public static IDisposable Create(AppDelegate app, int port)
+ {
+ return Create(app, port, "");
+ }
+ public static IDisposable Create(AppDelegate app, int port, string path)
+ {
+ return new Disposable(() => { });
+ }
+
+
+ public class Disposable : IDisposable
+ {
+ readonly Action _dispose;
+
+ public Disposable(Action dispose)
+ {
+
+
+
+ _dispose = dispose;
+ }
+
+ public void Dispose()
+ {
+ _dispose();
+ }
+ }
+ }
+}
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+ <ProductVersion>8.0.30703</ProductVersion>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{F14C74DA-D22E-4D14-AD5E-1F4F9DF9D69E}</ProjectGuid>
+ <OutputType>Library</OutputType>
+ <AppDesignerFolder>Properties</AppDesignerFolder>
+ <RootNamespace>Gate.Hosts.Manos.Tests</RootNamespace>
+ <AssemblyName>Gate.Hosts.Manos.Tests</AssemblyName>
+ <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+ <FileAlignment>512</FileAlignment>
+ <SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\Gate\</SolutionDir>
+ <RestorePackages>true</RestorePackages>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+ <DebugSymbols>true</DebugSymbols>
+ <DebugType>full</DebugType>
+ <Optimize>false</Optimize>
+ <OutputPath>bin\Debug\</OutputPath>
+ <DefineConstants>DEBUG;TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+ <DebugType>pdbonly</DebugType>
+ <Optimize>true</Optimize>
+ <OutputPath>bin\Release\</OutputPath>
+ <DefineConstants>TRACE</DefineConstants>
+ <ErrorReport>prompt</ErrorReport>
+ <WarningLevel>4</WarningLevel>
+ </PropertyGroup>
+ <ItemGroup>
+ <Reference Include="nunit.framework">
+ <HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="nunit.mocks">
+ <HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\nunit.mocks.dll</HintPath>
+ </Reference>
+ <Reference Include="pnunit.framework">
+ <HintPath>..\..\..\packages\NUnit.2.5.10.11092\lib\pnunit.framework.dll</HintPath>
+ </Reference>
+ <Reference Include="System" />
+ <Reference Include="System.Core" />
+ <Reference Include="System.Xml.Linq" />
+ <Reference Include="System.Data.DataSetExtensions" />
+ <Reference Include="Microsoft.CSharp" />
+ <Reference Include="System.Data" />
+ <Reference Include="System.Xml" />
+ </ItemGroup>
+ <ItemGroup>
+ <Compile Include="ServerTests.cs" />
+ <Compile Include="Properties\AssemblyInfo.cs" />
+ </ItemGroup>
+ <ItemGroup>
+ <None Include="packages.config" />
+ </ItemGroup>
+ <ItemGroup>
+ <ProjectReference Include="..\..\Hosts\Gate.Hosts.Manos\Gate.Hosts.Manos.csproj">
+ <Project>{A3C2FFB6-663E-4C94-884A-41ADB22DB724}</Project>
+ <Name>Gate.Hosts.Manos</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Main\Gate.Helpers\Gate.Helpers.csproj">
+ <Project>{85392B05-6564-472B-9A7B-58AFB721F2AE}</Project>
+ <Name>Gate.Helpers</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Main\Gate.Owin\Gate.Owin.csproj">
+ <Project>{B60C657C-80DA-4AA3-8796-AD920D5EB5A0}</Project>
+ <Name>Gate.Owin</Name>
+ </ProjectReference>
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Import Project="$(SolutionDir)\.nuget\nuget.targets" />
+ <!-- To modify your build process, add your task inside one of the targets below and uncomment it.
+ Other similar extension points exist, see Microsoft.Common.targets.
+ <Target Name="BeforeBuild">
+ </Target>
+ <Target Name="AfterBuild">
+ </Target>
+ -->
+</Project>
@@ -0,0 +1,32 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("Gate.Hosts.Manos.Tests")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible
+// to COM components. If you need to access a type in this assembly from
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("de93cda9-68cd-4190-988b-c0119526f7ba")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
@@ -0,0 +1,39 @@
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Net;
+using System.Text;
+using Gate.Helpers;
+using NUnit.Framework;
+
+namespace Gate.Hosts.Manos.Tests
+{
+ [TestFixture]
+ public class ServerTests
+ {
+ [Test]
+ public void ServerCanBeCreatedAndDisposed()
+ {
+ var server = Server.Create((env, result, fault) => { throw new NotImplementedException(); }, 8090, "");
+ server.Dispose();
+ }
+
+ [Test]
+ public void ServerWillRespondToRequests()
+ {
+ using (Server.Create(Wilson.App(), 8090))
+ {
+ var request = (HttpWebRequest)WebRequest.Create("http://localhost:8090");
+ using (var response = (HttpWebResponse)request.GetResponse())
+ {
+ using (var reader = new StreamReader(response.GetResponseStream()))
+ {
+ var text = reader.ReadToEnd();
+ Assert.That(text, Is.StringContaining("hello world"));
+ }
+ }
+ }
+ }
+ }
+}
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="utf-8"?>
+<packages>
+ <package id="NUnit" version="2.5.10.11092" />
+</packages>

0 comments on commit d7654f1

Please sign in to comment.