Beispiel #1
0
        public async Task AppOfflineDropped_CanRemoveAppOfflineAfterAddingAndSiteWorks(HostingModel hostingModel)
        {
            var deploymentResult = await DeployApp(hostingModel);

            AddAppOffline(deploymentResult.ContentRoot);

            await AssertAppOffline(deploymentResult);

            RemoveAppOffline(deploymentResult.ContentRoot);

            await AssertRunning(deploymentResult);
        }
Beispiel #2
0
        private async Task <IISDeploymentResult> DeployApp(HostingModel hostingModel = HostingModel.InProcess)
        {
            var deploymentParameters = _fixture.GetBaseDeploymentParameters(hostingModel: hostingModel);

            return(await DeployAsync(deploymentParameters));
        }
Beispiel #3
0
 public string GetHostUrl(HostingModel hostingModel)
 {
     return(this.SampleSites[hostingModel].GetUrl());
 }
Beispiel #4
0
        private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string expected, HostingModel hostingModel)
        {
            var deploymentParameters = Fixture.GetBaseDeploymentParameters(hostingModel);

            if (disableWebSocket)
            {
                // For IIS, we need to modify the apphost.config file
                deploymentParameters.AddServerConfigAction(
                    element => element.Descendants("webSocket")
                    .Single()
                    .SetAttributeValue("enabled", "false"));
            }

            var deploymentResult = await DeployAsync(deploymentParameters);

            var response = await deploymentResult.HttpClient.GetAsync("UpgradeFeatureDetection");

            var responseText = await response.Content.ReadAsStringAsync();

            Assert.Equal(expected, responseText);
        }
Beispiel #5
0
 public WCFClientTestBase(ConsoleDynamicMethodFixtureFWLatest fixture, ITestOutputHelper output, WCFBindingType bindingToTest, TracingTestOption tracingTestOption, HostingModel hostingTestOption, ASPCompatibilityMode aspCompatModeOption, IWCFLogHelpers logHelpersImpl)
     : base(fixture, output, bindingToTest, _instrumentedClientInvocMethods, new[] { WCFInvocationMethod.Sync }, tracingTestOption, hostingTestOption, aspCompatModeOption, logHelpersImpl)
 {
 }
Beispiel #6
0
 public void StartHost(HostingModel hostingModel)
 {
     this.SampleSites[hostingModel].Start();
 }
 public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
 {
     return(GetBaseDeploymentParameters(
                publisher,
                new DeploymentParameters(publisher.ApplicationPath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
     {
         HostingModel = hostingModel,
         TargetFramework = Tfm.NetCoreApp30,
         AncmVersion = AncmVersion.AspNetCoreModuleV2
     },
                publish));
 }
        public async Task AppOfflineDroppedWhileSiteFailedToStartInShim_AppOfflineServed(HostingModel hostingModel, int statusCode, string content)
        {
            var deploymentParameters = Fixture.GetBaseDeploymentParameters(hostingModel: hostingModel);

            deploymentParameters.WebConfigActionList.Add(WebConfigHelpers.AddOrModifyAspNetCoreSection("processPath", "nonexistent"));

            var deploymentResult = await DeployAsync(deploymentParameters);

            var result = await deploymentResult.HttpClient.GetAsync("/");

            Assert.Equal(statusCode, (int)result.StatusCode);
            Assert.Contains(content, await result.Content.ReadAsStringAsync());

            AddAppOffline(deploymentResult.ContentRoot);

            await AssertAppOffline(deploymentResult);

            DeletePublishOutput(deploymentResult);
        }
        public IISDeploymentParameters GetBaseDeploymentParameters(HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
        {
            var publisher = hostingModel == HostingModel.InProcess ? InProcessTestSite : OutOfProcessTestSite;

            return(GetBaseDeploymentParameters(publisher, hostingModel, publish));
        }
Beispiel #10
0
        private async Task <IISDeploymentResult> DeployApp(HostingModel hostingModel = HostingModel.InProcess)
        {
            var deploymentParameters = Helpers.GetBaseDeploymentParameters(hostingModel: hostingModel, publish: true);

            return(await DeployAsync(deploymentParameters));
        }
Beispiel #11
0
        // Defaults to inprocess specific deployment parameters
        public static IISDeploymentParameters GetBaseDeploymentParameters(string site = null, HostingModel hostingModel = HostingModel.InProcess, bool publish = false)
        {
            if (site == null)
            {
                site = hostingModel == HostingModel.InProcess ? "InProcessWebSite" : "OutOfProcessWebSite";
            }

            return(new IISDeploymentParameters(GetTestWebSitePath(site), DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
            {
                TargetFramework = Tfm.NetCoreApp22,
                ApplicationType = ApplicationType.Portable,
                AncmVersion = AncmVersion.AspNetCoreModuleV2,
                HostingModel = hostingModel,
                PublishApplicationBeforeDeployment = publish,
            });
        }
        private async Task UpgradeFeatureDetectionDeployer(bool disableWebSocket, string sitePath, string expected, HostingModel hostingModel)
        {
            var deploymentParameters = new DeploymentParameters(sitePath, DeployerSelector.ServerType, RuntimeFlavor.CoreClr, RuntimeArchitecture.x64)
            {
                TargetFramework = Tfm.NetCoreApp22,
                ApplicationType = ApplicationType.Portable,
                AncmVersion     = AncmVersion.AspNetCoreModuleV2,
                HostingModel    = hostingModel,
                PublishApplicationBeforeDeployment = hostingModel == HostingModel.InProcess
            };

            if (disableWebSocket)
            {
                // For IIS, we need to modify the apphost.config file
                deploymentParameters.ServerConfigTemplateContent = GetServerConfig(
                    element => element.Descendants("webSocket")
                    .Single()
                    .SetAttributeValue("enabled", "false"));
            }

            var deploymentResult = await DeployAsync(deploymentParameters);

            var response = await deploymentResult.RetryingHttpClient.GetAsync("UpgradeFeatureDetection");

            var responseText = await response.Content.ReadAsStringAsync();

            Assert.Equal(expected, responseText);
        }
Beispiel #13
0
 public IISDeploymentParameters GetBaseDeploymentParameters(ApplicationPublisher publisher, HostingModel hostingModel = HostingModel.InProcess)
 {
     return(GetBaseDeploymentParameters(
                publisher,
                new DeploymentParameters()
     {
         ServerType = DeployerSelector.ServerType,
         RuntimeFlavor = RuntimeFlavor.CoreClr,
         RuntimeArchitecture = RuntimeArchitecture.x64,
         HostingModel = hostingModel,
         TargetFramework = Tfm.NetCoreApp31
     }));
 }