diff options
Diffstat (limited to 'src/ext/Http/test/WixToolsetTest.Http')
10 files changed, 177 insertions, 0 deletions
diff --git a/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs new file mode 100644 index 00000000..40b49327 --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/HttpExtensionFixture.cs | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | // Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
| 2 | |||
| 3 | namespace WixToolsetTest.Http | ||
| 4 | { | ||
| 5 | using WixBuildTools.TestSupport; | ||
| 6 | using WixToolset.Core.TestPackage; | ||
| 7 | using WixToolset.Http; | ||
| 8 | using Xunit; | ||
| 9 | |||
| 10 | public class HttpExtensionFixture | ||
| 11 | { | ||
| 12 | [Fact] | ||
| 13 | public void CanBuildUsingSniSssl() | ||
| 14 | { | ||
| 15 | var folder = TestData.Get("TestData", "SniSsl"); | ||
| 16 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); | ||
| 17 | |||
| 18 | var results = build.BuildAndQuery(Build, "CustomAction", "Wix4HttpSniSslCert"); | ||
| 19 | WixAssert.CompareLineByLine(new[] | ||
| 20 | { | ||
| 21 | "CustomAction:Wix4ExecHttpSniSslCertsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | ||
| 22 | "CustomAction:Wix4ExecHttpSniSslCertsUninstall_X86\t3073\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | ||
| 23 | "CustomAction:Wix4RollbackHttpSniSslCertsInstall_X86\t3329\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | ||
| 24 | "CustomAction:Wix4RollbackHttpSniSslCertsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpSniSslCerts\t", | ||
| 25 | "CustomAction:Wix4SchedHttpSniSslCertsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsInstall\t", | ||
| 26 | "CustomAction:Wix4SchedHttpSniSslCertsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpSniSslCertsUninstall\t", | ||
| 27 | "Wix4HttpSniSslCert:sslC9YX6_H7UL_WGBx4DoDGI.Sj.D0\texample.com\t8080\t[SOME_THUMBPRINT]\t\t\t2\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
| 28 | }, results); | ||
| 29 | } | ||
| 30 | |||
| 31 | [Fact] | ||
| 32 | public void CanBuildUsingUrlReservation() | ||
| 33 | { | ||
| 34 | var folder = TestData.Get(@"TestData\UsingUrlReservation"); | ||
| 35 | var build = new Builder(folder, typeof(HttpExtensionFactory), new[] { folder }); | ||
| 36 | |||
| 37 | var results = build.BuildAndQuery(Build, "CustomAction", "Wix4HttpUrlAce", "Wix4HttpUrlReservation"); | ||
| 38 | WixAssert.CompareLineByLine(new[] | ||
| 39 | { | ||
| 40 | "CustomAction:Wix4ExecHttpUrlReservationsInstall_X86\t3073\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | ||
| 41 | "CustomAction:Wix4ExecHttpUrlReservationsUninstall_X86\t3073\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | ||
| 42 | "CustomAction:Wix4RollbackHttpUrlReservationsInstall_X86\t3329\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | ||
| 43 | "CustomAction:Wix4RollbackHttpUrlReservationsUninstall_X86\t3329\tWix4HttpCA_X86\tExecHttpUrlReservations\t", | ||
| 44 | "CustomAction:Wix4SchedHttpUrlReservationsInstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsInstall\t", | ||
| 45 | "CustomAction:Wix4SchedHttpUrlReservationsUninstall_X86\t1\tWix4HttpCA_X86\tSchedHttpUrlReservationsUninstall\t", | ||
| 46 | "Wix4HttpUrlAce:aceu5os2gQoblRmzwjt85LQf997uD4\turlO23FkY2xzEY54lY6E6sXFW6glXc\tNT SERVICE\\TestService\t268435456", | ||
| 47 | "Wix4HttpUrlReservation:urlO23FkY2xzEY54lY6E6sXFW6glXc\t0\t\thttp://+:80/vroot/\tfilF5_pLhBuF5b4N9XEo52g_hUM5Lo", | ||
| 48 | }, results); | ||
| 49 | } | ||
| 50 | |||
| 51 | private static void Build(string[] args) | ||
| 52 | { | ||
| 53 | var result = WixRunner.Execute(args) | ||
| 54 | .AssertSuccess(); | ||
| 55 | } | ||
| 56 | } | ||
| 57 | } | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.en-us.wxl b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.en-us.wxl | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.wxs b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.wxs new file mode 100644 index 00000000..c85e9bba --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/Package.wxs | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="MsiPackage" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | ||
| 3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 4 | |||
| 5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 6 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 7 | </Feature> | ||
| 8 | </Package> | ||
| 9 | |||
| 10 | <Fragment> | ||
| 11 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 12 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 13 | </StandardDirectory> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/PackageComponents.wxs b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/PackageComponents.wxs new file mode 100644 index 00000000..f0aae485 --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/PackageComponents.wxs | |||
| @@ -0,0 +1,12 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| 3 | xmlns:http="http://wixtoolset.org/schemas/v4/wxs/http"> | ||
| 4 | <Fragment> | ||
| 5 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 6 | <Component> | ||
| 7 | <File Source="example.txt" /> | ||
| 8 | <http:SniSslCertificate Host="example.com" Port="8080" Thumbprint="[SOME_THUMBPRINT]" HandleExisting="fail" /> | ||
| 9 | </Component> | ||
| 10 | </ComponentGroup> | ||
| 11 | </Fragment> | ||
| 12 | </Wix> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/example.txt b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/SniSsl/example.txt | |||
| @@ -0,0 +1 @@ | |||
| This is example.txt. \ No newline at end of file | |||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl new file mode 100644 index 00000000..38c12ac1 --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.en-us.wxl | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | |||
| 3 | <!-- | ||
| 4 | This file contains the declaration of all the localizable strings. | ||
| 5 | --> | ||
| 6 | <WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US"> | ||
| 7 | |||
| 8 | <String Id="DowngradeError">A newer version of [ProductName] is already installed.</String> | ||
| 9 | <String Id="FeatureTitle">MsiPackage</String> | ||
| 10 | |||
| 11 | </WixLocalization> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.wxs b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.wxs new file mode 100644 index 00000000..bd31e81f --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/Package.wxs | |||
| @@ -0,0 +1,15 @@ | |||
| 1 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
| 2 | <Package Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" InstallerVersion="200"> | ||
| 3 | <MajorUpgrade DowngradeErrorMessage="!(loc.DowngradeError)" /> | ||
| 4 | |||
| 5 | <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> | ||
| 6 | <ComponentGroupRef Id="ProductComponents" /> | ||
| 7 | </Feature> | ||
| 8 | </Package> | ||
| 9 | |||
| 10 | <Fragment> | ||
| 11 | <StandardDirectory Id="ProgramFilesFolder"> | ||
| 12 | <Directory Id="INSTALLFOLDER" Name="MsiPackage" /> | ||
| 13 | </StandardDirectory> | ||
| 14 | </Fragment> | ||
| 15 | </Wix> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs new file mode 100644 index 00000000..780d598b --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/PackageComponents.wxs | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs" | ||
| 3 | xmlns:http="http://wixtoolset.org/schemas/v4/wxs/http"> | ||
| 4 | <Fragment> | ||
| 5 | <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER"> | ||
| 6 | <Component> | ||
| 7 | <File Source="example.txt" /> | ||
| 8 | <ServiceInstall Name="TestService" Type="ownProcess" Start="auto" ErrorControl="ignore"> | ||
| 9 | <http:UrlReservation Url="http://+:80/vroot/"> | ||
| 10 | <http:UrlAce Rights="all" /> | ||
| 11 | </http:UrlReservation> | ||
| 12 | </ServiceInstall> | ||
| 13 | </Component> | ||
| 14 | </ComponentGroup> | ||
| 15 | </Fragment> | ||
| 16 | </Wix> | ||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt new file mode 100644 index 00000000..1b4ffe8a --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/TestData/UsingUrlReservation/example.txt | |||
| @@ -0,0 +1 @@ | |||
| This is example.txt. \ No newline at end of file | |||
diff --git a/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj new file mode 100644 index 00000000..7e60e426 --- /dev/null +++ b/src/ext/Http/test/WixToolsetTest.Http/WixToolsetTest.Http.csproj | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | <?xml version="1.0" encoding="utf-8"?> | ||
| 2 | <!-- Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. --> | ||
| 3 | |||
| 4 | <Project Sdk="Microsoft.NET.Sdk"> | ||
| 5 | <PropertyGroup> | ||
| 6 | <TargetFramework>netcoreapp3.1</TargetFramework> | ||
| 7 | <IsPackable>false</IsPackable> | ||
| 8 | </PropertyGroup> | ||
| 9 | |||
| 10 | <PropertyGroup> | ||
| 11 | <NoWarn>NU1701</NoWarn> | ||
| 12 | </PropertyGroup> | ||
| 13 | |||
| 14 | <ItemGroup> | ||
| 15 | <Content Include="TestData\**" CopyToOutputDirectory="PreserveNewest" /> | ||
| 16 | </ItemGroup> | ||
| 17 | |||
| 18 | <ItemGroup> | ||
| 19 | <ProjectReference Include="..\..\wixext\WixToolset.Http.wixext.csproj" /> | ||
| 20 | </ItemGroup> | ||
| 21 | |||
| 22 | <ItemGroup> | ||
| 23 | <PackageReference Include="WixToolset.Core" Version="4.0.*" /> | ||
| 24 | <PackageReference Include="WixToolset.Core.Burn" Version="4.0.*" /> | ||
| 25 | <PackageReference Include="WixToolset.Core.WindowsInstaller" Version="4.0.*" /> | ||
| 26 | <PackageReference Include="WixToolset.Core.TestPackage" Version="4.0.*" /> | ||
| 27 | </ItemGroup> | ||
| 28 | |||
| 29 | <ItemGroup> | ||
| 30 | <PackageReference Include="WixBuildTools.TestSupport" Version="4.0.*" /> | ||
| 31 | </ItemGroup> | ||
| 32 | |||
| 33 | <ItemGroup> | ||
| 34 | <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.3.0" /> | ||
| 35 | <PackageReference Include="xunit" Version="2.4.1" /> | ||
| 36 | <PackageReference Include="xunit.runner.visualstudio" Version="2.4.1" PrivateAssets="All" /> | ||
| 37 | </ItemGroup> | ||
| 38 | </Project> | ||
