diff --git a/build/applicationHost.config b/build/applicationHost.config new file mode 100644 index 0000000000..a19b96784b --- /dev/null +++ b/build/applicationHost.config @@ -0,0 +1,889 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ +
+ + +
+
+
+
+ +
+
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Client/HubProxyFacts.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Client/HubProxyFacts.cs index ebe8a16a3e..8fe17b4f65 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Client/HubProxyFacts.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Client/HubProxyFacts.cs @@ -15,8 +15,8 @@ public class HubProxyFacts : HostedTest [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void EndToEndTest(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostType.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostType.cs index ca9423b92c..cb1ef8d1ec 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostType.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostType.cs @@ -2,7 +2,7 @@ { public enum HostType { - IIS, + IISExpress, Memory } } diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostedTest.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostedTest.cs index 031542d036..a196f6e44c 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostedTest.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/HostedTest.cs @@ -13,8 +13,8 @@ protected ITestHost CreateHost(HostType hostType, TransportType transportType) switch (hostType) { - case HostType.IIS: - host = new IISTestHost(); + case HostType.IISExpress: + host = new IISExpressTestHost(); host.Transport = CreateTransport(transportType); break; case HostType.Memory: diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/Executable.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/Executable.cs deleted file mode 100644 index ad818bcaa6..0000000000 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/Executable.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Diagnostics; -using System.IO; - -namespace Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.IIS -{ - internal class Executable - { - public Executable(string path, string workingDirectory) - { - Path = path; - WorkingDirectory = workingDirectory; - } - - public string WorkingDirectory { get; private set; } - public string Path { get; private set; } - - public Tuple Execute(string arguments, params object[] args) - { - - var process = CreateProcess(arguments, args); - process.Start(); - - Func reader = (StreamReader streamReader) => streamReader.ReadToEnd(); - - IAsyncResult outputReader = reader.BeginInvoke(process.StandardOutput, null, null); - IAsyncResult errorReader = reader.BeginInvoke(process.StandardError, null, null); - - process.StandardInput.Close(); - - process.WaitForExit(); - - string output = reader.EndInvoke(outputReader); - string error = reader.EndInvoke(errorReader); - - // Sometimes, we get an exit code of 1 even when the command succeeds (e.g. with 'git reset .'). - // So also make sure there is an error string - if (process.ExitCode != 0) - { - string text = String.IsNullOrEmpty(error) ? output : error; - - throw new Exception(text); - } - return Tuple.Create(output, error); - - } - - private Process CreateProcess(string arguments, object[] args) - { - var psi = new ProcessStartInfo - { - FileName = Path, - WorkingDirectory = WorkingDirectory, - RedirectStandardInput = true, - RedirectStandardOutput = true, - RedirectStandardError = true, - CreateNoWindow = true, - WindowStyle = ProcessWindowStyle.Hidden, - UseShellExecute = false, - ErrorDialog = false, - Arguments = String.Format(arguments, args) - }; - - var process = new Process() - { - StartInfo = psi - }; - - return process; - } - } -} diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/IISExtensions.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/IISExtensions.cs deleted file mode 100644 index daa7962718..0000000000 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/IISExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -using IISServer = Microsoft.Web.Administration; - -namespace Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.IIS -{ - public static class IISExtensions - { - public static void StopAndWait(this IISServer.Site site) - { - var wait = new PollingWait(() => site.Stop(), () => site.State == IISServer.ObjectState.Stopped); - - wait.Invoke(); - } - - public static void WaitForState(this IISServer.ApplicationPool appPool, IISServer.ObjectState state) - { - new PollingWait(() => { }, () => appPool.State == state).Invoke(); - } - - public static void WaitForState(this IISServer.Site site, IISServer.ObjectState state) - { - new PollingWait(() => { }, () => site.State == state).Invoke(); - } - } -} diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/PollingWait.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/PollingWait.cs deleted file mode 100644 index 29708140cb..0000000000 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/PollingWait.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Threading; - -namespace Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.IIS -{ - internal class PollingWait - { - private readonly Action _action; - private readonly Func _isComplete; - - public PollingWait(Action action, Func isComplete) - { - _action = action; - _isComplete = isComplete; - } - - public bool IsComplete - { - get - { - try - { - return _isComplete(); - } - catch - { - return false; - } - } - } - - public void Invoke() - { - _action(); - - while (!IsComplete) - { - Thread.Sleep(500); - } - } - } -} diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/SiteManager.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/SiteManager.cs index 9ba428b82e..e5a645220a 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/SiteManager.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IIS/SiteManager.cs @@ -1,8 +1,8 @@ using System; using System.Diagnostics; using System.IO; -using System.Net.NetworkInformation; -using IISServer = Microsoft.Web.Administration; +using System.Threading; +using Microsoft.Web.Administration; namespace Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure.IIS { @@ -11,103 +11,53 @@ public class SiteManager private static Random portNumberGenRnd = new Random((int)DateTime.Now.Ticks); private readonly string _path; + private readonly string _appHostConfigPath; + private readonly string _iisHomePath; + private readonly ServerManager _serverManager; + private static Process _iisExpressProcess; + + private static readonly string IISExpressPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles), + "IIS Express", + "iisexpress.exe"); + + private const string TestSiteName = "signalr-test-site"; public SiteManager(string path) { _path = Path.GetFullPath(path); + _appHostConfigPath = Path.GetFullPath(Path.Combine(_path, "..", "..", "config", "applicationHost.config")); + _iisHomePath = Path.GetFullPath(Path.Combine(_appHostConfigPath, "..", "..")); + _serverManager = new ServerManager(_appHostConfigPath); } - public string CreateSite(string applicationName) + public string GetSiteUrl() { - var iis = new IISServer.ServerManager(); - - try - { - Directory.CreateDirectory(_path); - - int sitePort = CreateSite(iis, applicationName, _path); - - string url = String.Format("http://localhost:{0}/", sitePort); + Site site = _serverManager.Sites[TestSiteName]; - // Commit the changes to iis - iis.CommitChanges(); - - // Get teh site after committing changes - var site = iis.Sites[applicationName]; - - // Wait until the site is in the started state - site.WaitForState(IISServer.ObjectState.Started); - - return url; - } - catch + if (site == null) { - DeleteSite(applicationName); - throw; - } - } + int sitePort = GetRandomPort(); + site = _serverManager.Sites.Add(TestSiteName, "http", "*:" + sitePort + ":localhost", _path); - public void DeleteSite(string applicationName) - { - var iis = new IISServer.ServerManager(); - - // Get the app pool for this application - var appPool = iis.ApplicationPools[applicationName]; - - // Make sure the acls are gone - RemoveAcls(applicationName); - - if (appPool == null) - { - // If there's no app pool then do nothing - return; + _serverManager.CommitChanges(); } - DeleteSite(iis, applicationName); + EnsureIISExpressProcess(); - iis.CommitChanges(); - - // Remove the app pool and commit changes - iis.ApplicationPools.Remove(iis.ApplicationPools[applicationName]); - iis.CommitChanges(); - } - - private void RemoveAcls(string appPoolName) - { - // Setup Acls for this user - var icacls = new Executable(@"C:\Windows\System32\icacls.exe", Directory.GetCurrentDirectory()); - - try - { - // Give full control to the app folder (we can make it minimal later) - icacls.Execute(@"""{0}"" /remove ""IIS AppPool\{1}""", _path, appPoolName); - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message); - } + return String.Format("http://localhost:{0}", site.Bindings[0].EndPoint.Port); } - private void SetupAcls(string appPoolName) + public void RecycleApplication() { - // Setup Acls for this user - var icacls = new Executable(@"C:\Windows\System32\icacls.exe", Directory.GetCurrentDirectory()); - - try - { - // Give full control to the app folder (we can make it minimal later) - icacls.Execute(@"""{0}"" /grant:r ""IIS AppPool\{1}:(OI)(CI)(F)"" /C /Q /T", _path, appPoolName); - } - catch (Exception ex) - { - Debug.WriteLine(ex.Message); - } + // This blows up with access denied. We need a way to force clearing the state without killing the process + // ApplicationPool appPool = _serverManager.ApplicationPools[_serverManager.ApplicationDefaults.ApplicationPoolName]; + // appPool.Stop(); } - private static int GetRandomPort(IISServer.ServerManager iis) + private int GetRandomPort() { int randomPort = portNumberGenRnd.Next(1025, 65535); - while (!IsAvailable(randomPort, iis)) + while (!IsPortAvailable(randomPort)) { randomPort = portNumberGenRnd.Next(1025, 65535); } @@ -115,18 +65,9 @@ private static int GetRandomPort(IISServer.ServerManager iis) return randomPort; } - private static bool IsAvailable(int port, IISServer.ServerManager iis) + private bool IsPortAvailable(int port) { - var tcpConnections = IPGlobalProperties.GetIPGlobalProperties().GetActiveTcpConnections(); - foreach (var connectionInfo in tcpConnections) - { - if (connectionInfo.LocalEndPoint.Port == port) - { - return false; - } - } - - foreach (var iisSite in iis.Sites) + foreach (var iisSite in _serverManager.Sites) { foreach (var binding in iisSite.Bindings) { @@ -140,46 +81,38 @@ private static bool IsAvailable(int port, IISServer.ServerManager iis) return true; } - private int CreateSite(IISServer.ServerManager iis, string applicationName, string siteRoot) - { - var appPool = EnsureAppPool(iis, applicationName); - int sitePort = GetRandomPort(iis); - var site = iis.Sites.Add(applicationName, siteRoot, sitePort); - site.ApplicationDefaults.ApplicationPoolName = appPool.Name; - - return sitePort; - } - - private static void DeleteSite(IISServer.ServerManager iis, string applicationName) + private void EnsureIISExpressProcess() { - var site = iis.Sites[applicationName]; - if (site != null) + Process oldProcess = Interlocked.CompareExchange(ref _iisExpressProcess, CreateIISExpressProcess(), null); + if (oldProcess == null) { - site.StopAndWait(); - iis.Sites.Remove(site); + _iisExpressProcess.Start(); + return; } } - private IISServer.ApplicationPool EnsureAppPool(IISServer.ServerManager iis, string applicationName) + private Process CreateIISExpressProcess() { - var appPool = iis.ApplicationPools[applicationName]; - - if (appPool == null) + if (!File.Exists(IISExpressPath)) { - iis.ApplicationPools.Add(applicationName); - iis.CommitChanges(); + throw new InvalidOperationException("Unable to locate IIS Express on the machine"); + } - appPool = iis.ApplicationPools[applicationName]; - appPool.ManagedPipelineMode = IISServer.ManagedPipelineMode.Integrated; - appPool.ManagedRuntimeVersion = "v4.0"; - appPool.AutoStart = true; - appPool.ProcessModel.LoadUserProfile = false; - appPool.WaitForState(IISServer.ObjectState.Started); + var iisExpressProcess = new Process(); + iisExpressProcess.StartInfo = new ProcessStartInfo(IISExpressPath, "/config:" + _appHostConfigPath); + iisExpressProcess.StartInfo.EnvironmentVariables["IIS_USER_HOME"] = _iisHomePath; + //iisExpressProcess.StartInfo.CreateNoWindow = false; + iisExpressProcess.StartInfo.UseShellExecute = false; + iisExpressProcess.EnableRaisingEvents = true; + iisExpressProcess.Exited += OnIIsExpressQuit; - SetupAcls(applicationName); - } + return iisExpressProcess; + } - return appPool; + void OnIIsExpressQuit(object sender, EventArgs e) + { + Interlocked.Exchange(ref _iisExpressProcess, null); } + } } \ No newline at end of file diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISTestHost.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISExpressTestHost.cs similarity index 86% rename from tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISTestHost.cs rename to tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISExpressTestHost.cs index 474cb87aed..8d55526f79 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISTestHost.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Infrastructure/IISExpressTestHost.cs @@ -6,10 +6,9 @@ namespace Microsoft.AspNet.SignalR.FunctionalTests.Infrastructure { - public class IISTestHost : ITestHost + public class IISExpressTestHost : ITestHost { private readonly SiteManager _siteManager; - private readonly string _applicationName; private readonly string _path; private readonly string _webConfigPath; private int _disposed = 0; @@ -31,11 +30,8 @@ public class IISTestHost : ITestHost "; - public IISTestHost() - { - // Create a random application name - _applicationName = "signalr_test_" + Guid.NewGuid().ToString().Substring(0, 8); - + public IISExpressTestHost() + { // The path to the site is the test path. // We treat the test output path just like a site. This makes it super // cheap to create and tear down sites. We don't need to copy any files. @@ -58,7 +54,7 @@ public void Initialize(int? keepAlive, int? hearbeatInterval, bool enableAutoRejoiningGroups) { - Url = _siteManager.CreateSite(_applicationName).Trim('/'); + Url = _siteManager.GetSiteUrl(); // Use a configuration file to specify values string content = String.Format(WebConfigTemplate, @@ -74,7 +70,7 @@ public void Dispose() { if (Interlocked.Exchange(ref _disposed, 1) == 0) { - _siteManager.DeleteSite(_applicationName); + _siteManager.RecycleApplication(); File.Delete(_webConfigPath); } diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Microsoft.AspNet.SignalR.FunctionalTests.csproj b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Microsoft.AspNet.SignalR.FunctionalTests.csproj index bef970cdbe..8a69e3d646 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Microsoft.AspNet.SignalR.FunctionalTests.csproj +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Microsoft.AspNet.SignalR.FunctionalTests.csproj @@ -35,7 +35,6 @@ False - ..\..\..\..\..\Windows\System32\inetsrv\Microsoft.Web.Administration.dll ..\..\packages\Moq.4.0.10827\lib\NET40\Moq.dll @@ -100,13 +99,10 @@ - - - - + @@ -116,6 +112,9 @@ + + + diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/ConnectionFacts.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/ConnectionFacts.cs index e0103d41c1..edb837e7fb 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/ConnectionFacts.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/ConnectionFacts.cs @@ -16,7 +16,7 @@ public class Start : HostedTest [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] // [InlineData(HostType.IIS, TransportType.LongPolling)] public void ThrownWebExceptionShouldBeUnwrapped(HostType hostType, TransportType transportType) { @@ -33,7 +33,7 @@ public void ThrownWebExceptionShouldBeUnwrapped(HostType hostType, TransportType using (var ser = aggEx.GetError()) { - if (hostType == HostType.IIS) + if (hostType == HostType.IISExpress) { Assert.Equal(System.Net.HttpStatusCode.InternalServerError, ser.StatusCode); } diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/PersistentConnectionFacts.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/PersistentConnectionFacts.cs index 781c3cdeda..0b80f444ed 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/PersistentConnectionFacts.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Connections/PersistentConnectionFacts.cs @@ -68,8 +68,8 @@ private static Task ProcessRequest(MemoryHost host, string transport, string con [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void GroupsAreNotReadOnConnectedAsync(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -94,8 +94,8 @@ public void GroupsAreNotReadOnConnectedAsync(HostType hostType, TransportType tr [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void SendRaisesOnReceivedFromAllEvents(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -129,8 +129,8 @@ public void SendRaisesOnReceivedFromAllEvents(HostType hostType, TransportType t [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void SendCanBeCalledAfterStateChangedEvent(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -170,7 +170,7 @@ public class OnReconnectedAsync : HostedTest [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] // [InlineData(HostType.IIS, TransportType.LongPolling)] public void ReconnectFiresAfterHostShutDown(HostType hostType, TransportType transportType) { @@ -222,7 +222,7 @@ public class GroupTest : HostedTest { [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GroupsReceiveMessages(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -261,7 +261,7 @@ public void GroupsReceiveMessages(HostType hostType, TransportType transportType [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GroupsDontRejoinByDefault(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -303,8 +303,8 @@ public void GroupsDontRejoinByDefault(HostType hostType, TransportType transport [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void GroupsRejoinedWhenOnRejoiningGroupsOverridden(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -348,8 +348,8 @@ public void GroupsRejoinedWhenOnRejoiningGroupsOverridden(HostType hostType, Tra [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void ClientGroupsSyncWithServerGroupsOnReconnect(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -393,7 +393,7 @@ public void ClientGroupsSyncWithServerGroupsOnReconnect(HostType hostType, Trans [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void ClientGroupsSyncWithServerGroupsOnReconnectWhenNotRejoiningGroups(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -442,8 +442,8 @@ public class SendFacts : HostedTest [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void SendToAllButCaller(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Hubs/HubFacts.cs b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Hubs/HubFacts.cs index f18d5c88e8..257dab4e9b 100644 --- a/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Hubs/HubFacts.cs +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/Server/Hubs/HubFacts.cs @@ -20,7 +20,7 @@ public class HubFacts : HostedTest { [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void ReadingState(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -41,11 +41,11 @@ public void ReadingState(HostType hostType, TransportType transportType) connection.Stop(); } - } + } [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void SettingState(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -67,7 +67,7 @@ public void SettingState(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GetValueFromServer(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -88,7 +88,7 @@ public void GetValueFromServer(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void TaskWithException(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -110,7 +110,7 @@ public void TaskWithException(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GenericTaskWithException(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -132,7 +132,7 @@ public void GenericTaskWithException(HostType hostType, TransportType transportT [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GenericTaskWithContinueWith(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -153,7 +153,7 @@ public void GenericTaskWithContinueWith(HostType hostType, TransportType transpo [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void Overloads(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -175,7 +175,7 @@ public void Overloads(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void UnsupportedOverloads(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -222,7 +222,7 @@ public void ChangeHubUrl() [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void GuidTest(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -265,7 +265,7 @@ public void HubHasConnectionEvents() [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void ComplexPersonState(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -317,7 +317,7 @@ public void ComplexPersonState(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void DynamicInvokeTest(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -344,7 +344,7 @@ public void DynamicInvokeTest(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void CreateProxyAfterConnectionStartsThrows(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -366,7 +366,7 @@ public void CreateProxyAfterConnectionStartsThrows(HostType hostType, TransportT [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void AddingToMultipleGroups(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -400,7 +400,7 @@ public void AddingToMultipleGroups(HostType hostType, TransportType transportTyp [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void HubGroupsDontRejoinByDefault(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -458,8 +458,8 @@ public void HubGroupsDontRejoinByDefault(HostType hostType, TransportType transp [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.LongPolling)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.LongPolling)] public void HubGroupsRejoinWhenAutoRejoiningGroupsEnabled(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -561,7 +561,7 @@ public void RejoiningGroupsOnlyReceivesGroupsBelongingToHub() [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void CustomQueryStringRaw(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -584,7 +584,7 @@ public void CustomQueryStringRaw(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void CustomQueryString(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -707,7 +707,7 @@ public void CreatedHubsGetDisposed() [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] [InlineData(HostType.Memory, TransportType.LongPolling)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void SendToAllButCaller(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -741,7 +741,7 @@ public void SendToAllButCaller(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void SendToAllButCallerInGroup(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -778,7 +778,7 @@ public void SendToAllButCallerInGroup(HostType hostType, TransportType transport [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void SendToAll(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) @@ -812,7 +812,7 @@ public void SendToAll(HostType hostType, TransportType transportType) [Theory] [InlineData(HostType.Memory, TransportType.ServerSentEvents)] - [InlineData(HostType.IIS, TransportType.ServerSentEvents)] + [InlineData(HostType.IISExpress, TransportType.ServerSentEvents)] public void SendToSelf(HostType hostType, TransportType transportType) { using (var host = CreateHost(hostType, transportType)) diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/applicationhost.config b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/applicationhost.config new file mode 100644 index 0000000000..44da0ebe0a --- /dev/null +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/applicationhost.config @@ -0,0 +1,1025 @@ + + + + + + + + +
+
+
+
+
+
+
+
+ + + +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+ +
+
+
+ + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/aspnet.config b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/aspnet.config new file mode 100644 index 0000000000..5a7f3fc521 --- /dev/null +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/aspnet.config @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/redirection.config b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/redirection.config new file mode 100644 index 0000000000..a32637bb3d --- /dev/null +++ b/tests/Microsoft.AspNet.SignalR.FunctionalTests/config/redirection.config @@ -0,0 +1,15 @@ + + + +
+ + + + + + + + + + + \ No newline at end of file