Permalink
Browse files

Switch to xUnit

  • Loading branch information...
1 parent 446eb27 commit dac4479df810621fdfa46fbbe2ebce812758059b @Bobris committed Mar 7, 2015
Showing with 4,986 additions and 11,207 deletions.
  1. +1 −0 .gitignore
  2. +1 −0 Nowin/IServerParameters.cs
  3. +16 −2 Nowin/Server.cs
  4. +15 −0 Nowin/ServerBuilder.cs
  5. +22 −4 NowinTests/NowinTests.csproj
  6. +190 −190 NowinTests/NowinTestsBase.cs
  7. +1 −2 NowinTests/NowinTestsPlain.cs
  8. +1 −2 NowinTests/NowinTestsSecure.cs
  9. +6 −1 NowinTests/packages.config
  10. BIN packages/NUnit.2.6.3/NUnit.2.6.3.nupkg
  11. +0 −27 packages/NUnit.2.6.3/NUnit.2.6.3.nuspec
  12. BIN packages/NUnit.2.6.3/lib/nunit.framework.dll
  13. +0 −10,960 packages/NUnit.2.6.3/lib/nunit.framework.xml
  14. +0 −15 packages/NUnit.2.6.3/license.txt
  15. +0 −4 packages/repositories.config
  16. BIN packages/xunit.2.0.0-rc3-build2880/xunit.2.0.0-rc3-build2880.nupkg
  17. BIN packages/xunit.abstractions.2.0.0-rc3-build2880/lib/net35/xunit.abstractions.dll
  18. +1,087 −0 packages/xunit.abstractions.2.0.0-rc3-build2880/lib/net35/xunit.abstractions.xml
  19. BIN ...rtable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.abstractions.dll
  20. +1,087 −0 ...rtable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.abstractions.xml
  21. BIN packages/xunit.abstractions.2.0.0-rc3-build2880/xunit.abstractions.2.0.0-rc3-build2880.nupkg
  22. BIN ...lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.assert.dll
  23. BIN ...lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.assert.pdb
  24. +1,417 −0 ...lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.assert.xml
  25. BIN packages/xunit.assert.2.0.0-rc3-build2880/xunit.assert.2.0.0-rc3-build2880.nupkg
  26. +10 −0 packages/xunit.core.2.0.0-rc3-build2880/build/Xamarin.iOS/xunit.core.props
  27. BIN packages/xunit.core.2.0.0-rc3-build2880/build/Xamarin.iOS/xunit.execution.iOS-Universal.dll
  28. BIN packages/xunit.core.2.0.0-rc3-build2880/build/_Desktop/xunit.execution.desktop.dll
  29. +10 −0 packages/xunit.core.2.0.0-rc3-build2880/build/monoandroid/xunit.core.props
  30. BIN packages/xunit.core.2.0.0-rc3-build2880/build/monoandroid/xunit.execution.MonoAndroid.dll
  31. +10 −0 packages/xunit.core.2.0.0-rc3-build2880/build/monotouch/xunit.core.props
  32. BIN packages/xunit.core.2.0.0-rc3-build2880/build/monotouch/xunit.execution.MonoTouch.dll
  33. +15 −0 ...ild/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.core.props
  34. +15 −0 packages/xunit.core.2.0.0-rc3-build2880/build/portable-win81+wpa81/xunit.core.props
  35. +14 −0 packages/xunit.core.2.0.0-rc3-build2880/build/portable-win81+wpa81/xunit.core.targets
  36. BIN packages/xunit.core.2.0.0-rc3-build2880/build/portable-win81+wpa81/xunit.execution.universal.dll
  37. BIN packages/xunit.core.2.0.0-rc3-build2880/build/portable-win81+wpa81/xunit.execution.universal.pri
  38. +15 −0 packages/xunit.core.2.0.0-rc3-build2880/build/win8/xunit.core.props
  39. +11 −0 packages/xunit.core.2.0.0-rc3-build2880/build/win8/xunit.core.targets
  40. BIN packages/xunit.core.2.0.0-rc3-build2880/build/win8/xunit.execution.win8.dll
  41. +10 −0 packages/xunit.core.2.0.0-rc3-build2880/build/wp8/xunit.core.props
  42. +11 −0 packages/xunit.core.2.0.0-rc3-build2880/build/wp8/xunit.core.targets
  43. BIN packages/xunit.core.2.0.0-rc3-build2880/build/wp8/xunit.execution.wp8.dll
  44. BIN packages/xunit.core.2.0.0-rc3-build2880/xunit.core.2.0.0-rc3-build2880.nupkg
  45. BIN ...0/lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.core.dll
  46. +5 −0 ...portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.core.dll.tdnet
  47. BIN ...0/lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.core.pdb
  48. +896 −0 ...0/lib/portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.core.xml
  49. BIN ...rtable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.runner.tdnet.dll
  50. BIN ...45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS/xunit.runner.utility.desktop.dll
  51. BIN ...s/xunit.extensibility.core.2.0.0-rc3-build2880/xunit.extensibility.core.2.0.0-rc3-build2880.nupkg
  52. BIN packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/_common/xunit.abstractions.dll
  53. BIN ...ages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/_common/xunit.runner.utility.desktop.dll
  54. BIN ...t.runner.visualstudio.2.0.0-rc3-build1046/build/_common/xunit.runner.visualstudio.testadapter.dll
  55. +20 −0 packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/net20/xunit.runner.visualstudio.props
  56. +20 −0 .../portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid/xunit.runner.visualstudio.props
  57. BIN packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/win8/xunit.runner.utility.win8.dll
  58. +20 −0 packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/win8/xunit.runner.visualstudio.props
  59. +17 −0 packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/win8/xunit.runner.visualstudio.targets
  60. BIN packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/win8/xunit.runner.visualstudio.win8.dll
  61. BIN ...ages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.utility.universal.dll
  62. BIN ...ages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.utility.universal.pri
  63. +20 −0 packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.visualstudio.props
  64. +23 −0 packages/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.visualstudio.targets
  65. BIN ...ges/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.visualstudio.wpa81.dll
  66. BIN ...ges/xunit.runner.visualstudio.2.0.0-rc3-build1046/build/wpa81/xunit.runner.visualstudio.wpa81.pri
  67. BIN ...xunit.runner.visualstudio.2.0.0-rc3-build1046/xunit.runner.visualstudio.2.0.0-rc3-build1046.nupkg
View
@@ -18,3 +18,4 @@ TestResults
*.crunchsolution.cache
*.DotSettings
/Nowin.sln.ide
+.vs
@@ -15,5 +15,6 @@ internal interface IServerParameters
Func<IDictionary<string, object>, Task> OwinApp { get; }
IDictionary<string, object> OwinCapabilities { get; }
string ServerHeader { get; }
+ TimeSpan RetrySocketBindingTime { get; }
}
}
View
@@ -1,3 +1,4 @@
+using System;
using System.Collections.Concurrent;
using System.Net.Sockets;
using System.Text;
@@ -61,7 +62,20 @@ public void Start()
_layerFactory = new SslTransportFactory(_parameters.Certificate, _layerFactory);
}
ListenSocket = new Socket(_parameters.EndPoint.AddressFamily, SocketType.Stream, ProtocolType.Tcp);
- ListenSocket.Bind(_parameters.EndPoint);
+ var start = DateTime.UtcNow;
+ while (true)
+ {
+ try
+ {
+ ListenSocket.Bind(_parameters.EndPoint);
+ break;
+ }
+ catch
+ {
+ if (start + _parameters.RetrySocketBindingTime <= DateTime.UtcNow) throw;
+ }
+ Thread.Sleep(50);
+ }
ListenSocket.Listen(100);
var initialConnectionCount = _connectionAllocationStrategy.CalculateNewConnectionCount(0, 0);
AllocatedConnections = initialConnectionCount;
@@ -87,7 +101,7 @@ public void Dispose()
if (ListenSocket != null)
{
- ListenSocket.Close();
+ ListenSocket.Dispose();
}
foreach (var block in _blocks)
@@ -15,6 +15,7 @@ public class ServerBuilder : IServerParameters
Func<IDictionary<string, object>, Task> _app;
IDictionary<string, object> _capabilities;
string _serverHeader = "Nowin";
+ private TimeSpan _retrySocketBindingTime;
public static ServerBuilder New()
{
@@ -27,6 +28,11 @@ public ServerBuilder SetConnectionAllocationStrategy(IConnectionAllocationStrate
return this;
}
+ public ServerBuilder SetRetrySocketBindingTime(TimeSpan value)
+ {
+ _retrySocketBindingTime = value;
+ return this;
+ }
public ServerBuilder SetPort(int port)
{
if (port < IPEndPoint.MinPort || port > IPEndPoint.MaxPort) throw new ArgumentOutOfRangeException("port", port, "must be in range of <0,65535>");
@@ -139,5 +145,14 @@ int IServerParameters.BufferSize
}
public string ServerHeader { get { return _serverHeader; }}
+
+ public TimeSpan RetrySocketBindingTime
+ {
+ get
+ {
+ return _retrySocketBindingTime;
+ throw new NotImplementedException();
+ }
+ }
}
}
@@ -1,5 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <Import Project="..\packages\xunit.core.2.0.0-rc3-build2880\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props" Condition="Exists('..\packages\xunit.core.2.0.0-rc3-build2880\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" />
+ <Import Project="..\packages\xunit.runner.visualstudio.2.0.0-rc3-build1046\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\packages\xunit.runner.visualstudio.2.0.0-rc3-build1046\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -12,6 +14,7 @@
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
+ <NuGetPackageImportStamp>fffbcd79</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -31,10 +34,6 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
- <Reference Include="nunit.framework, Version=2.6.3.13283, Culture=neutral, PublicKeyToken=96d09a1eb7f44a77, processorArchitecture=MSIL">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\packages\NUnit.2.6.3\lib\nunit.framework.dll</HintPath>
- </Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Net.Http" />
@@ -43,6 +42,15 @@
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
+ <Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
+ <HintPath>..\packages\xunit.abstractions.2.0.0-rc3-build2880\lib\net35\xunit.abstractions.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.assert">
+ <HintPath>..\packages\xunit.assert.2.0.0-rc3-build2880\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.assert.dll</HintPath>
+ </Reference>
+ <Reference Include="xunit.core">
+ <HintPath>..\packages\xunit.extensibility.core.2.0.0-rc3-build2880\lib\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.dll</HintPath>
+ </Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="NowinTestsSecure.cs" />
@@ -60,7 +68,17 @@
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
+ <ItemGroup>
+ <Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
+ </ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+ <Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
+ <PropertyGroup>
+ <ErrorText>This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
+ </PropertyGroup>
+ <Error Condition="!Exists('..\packages\xunit.runner.visualstudio.2.0.0-rc3-build1046\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.runner.visualstudio.2.0.0-rc3-build1046\build\net20\xunit.runner.visualstudio.props'))" />
+ <Error Condition="!Exists('..\packages\xunit.core.2.0.0-rc3-build2880\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\packages\xunit.core.2.0.0-rc3-build2880\build\portable-net45+aspnetcore50+win+wpa81+wp80+monotouch+monoandroid+Xamarin.iOS\xunit.core.props'))" />
+ </Target>
<!-- 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">
Oops, something went wrong.

0 comments on commit dac4479

Please sign in to comment.