diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2022-03-30 17:08:40 -0500 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2022-04-01 22:06:11 -0500 |
commit | 386a3578413ba16b3c0615d47870ee44a0e461f6 (patch) | |
tree | 1dfcea9e5080f1f15cc880aba1541a962426c58b /src/test | |
parent | d97c0d1685ef4c3840776327e76ce25d4dbdbeb1 (diff) | |
download | wix-386a3578413ba16b3c0615d47870ee44a0e461f6.tar.gz wix-386a3578413ba16b3c0615d47870ee44a0e461f6.tar.bz2 wix-386a3578413ba16b3c0615d47870ee44a0e461f6.zip |
Implement BundlePackage.
3693
Diffstat (limited to 'src/test')
3 files changed, 81 insertions, 0 deletions
diff --git a/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wixproj b/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wixproj new file mode 100644 index 00000000..a9639014 --- /dev/null +++ b/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wixproj | |||
@@ -0,0 +1,19 @@ | |||
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 | <Project Sdk="WixToolset.Sdk"> | ||
3 | <PropertyGroup> | ||
4 | <OutputType>Bundle</OutputType> | ||
5 | <UpgradeCode>{86D214FB-8D74-456C-99B3-6557ECA6159C}</UpgradeCode> | ||
6 | </PropertyGroup> | ||
7 | <ItemGroup> | ||
8 | <Compile Include="..\..\Templates\Bundle.wxs" Link="Bundle.wxs" /> | ||
9 | </ItemGroup> | ||
10 | <ItemGroup> | ||
11 | <ProjectReference Include="..\..\BasicFunctionalityTests\BundleA\BundleA.wixproj" /> | ||
12 | <ProjectReference Include="..\..\BasicFunctionalityTests\BundleB_x64\BundleB_x64.wixproj" /> | ||
13 | <ProjectReference Include="..\..\TestBA\TestBAWixlib\testbawixlib.wixproj" /> | ||
14 | </ItemGroup> | ||
15 | <ItemGroup> | ||
16 | <PackageReference Include="WixToolset.Bal.wixext" /> | ||
17 | <PackageReference Include="WixToolset.NetFx.wixext" /> | ||
18 | </ItemGroup> | ||
19 | </Project> \ No newline at end of file | ||
diff --git a/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wxs b/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wxs new file mode 100644 index 00000000..e0071874 --- /dev/null +++ b/src/test/burn/TestData/BundlePackageTests/MultipleBundlePackagesBundle/MultipleBundlePackagesBundle.wxs | |||
@@ -0,0 +1,11 @@ | |||
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 | |||
4 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
5 | <Fragment> | ||
6 | <PackageGroup Id="BundlePackages"> | ||
7 | <BundlePackage Id="PackageA" SourceFile="$(var.BundleA.TargetPath)" /> | ||
8 | <BundlePackage Id="PackageB" SourceFile="$(var.BundleB_x64.TargetPath)" /> | ||
9 | </PackageGroup> | ||
10 | </Fragment> | ||
11 | </Wix> | ||
diff --git a/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs b/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs new file mode 100644 index 00000000..2e95aedb --- /dev/null +++ b/src/test/burn/WixToolsetTest.BurnE2E/BundlePackageTests.cs | |||
@@ -0,0 +1,51 @@ | |||
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.BurnE2E | ||
4 | { | ||
5 | using System.IO; | ||
6 | using Xunit; | ||
7 | using Xunit.Abstractions; | ||
8 | |||
9 | public class BundlePackageTests : BurnE2ETests | ||
10 | { | ||
11 | public BundlePackageTests(ITestOutputHelper testOutputHelper) : base(testOutputHelper) { } | ||
12 | |||
13 | [Fact] | ||
14 | public void CanInstallAndUninstallBundlePackages() | ||
15 | { | ||
16 | var packageA = this.CreatePackageInstaller(@"..\BasicFunctionalityTests\PackageA"); | ||
17 | var packageA_x64 = this.CreatePackageInstaller(@"..\BasicFunctionalityTests\PackageA_x64"); | ||
18 | var bundleA = this.CreateBundleInstaller(@"..\BasicFunctionalityTests\BundleA"); | ||
19 | var bundleB_x64 = this.CreateBundleInstaller(@"..\BasicFunctionalityTests\BundleB_x64"); | ||
20 | var multipleBundlePackagesBundle = this.CreateBundleInstaller(@"MultipleBundlePackagesBundle"); | ||
21 | |||
22 | var packageA32SourceCodeFilePath = packageA.GetInstalledFilePath("Package.wxs"); | ||
23 | var packageA64SourceCodeFilePath = packageA_x64.GetInstalledFilePath("Package.wxs"); | ||
24 | |||
25 | // Source file should *not* be installed | ||
26 | Assert.False(File.Exists(packageA32SourceCodeFilePath), $"PackageA payload should not be there on test start: {packageA32SourceCodeFilePath}"); | ||
27 | Assert.False(File.Exists(packageA64SourceCodeFilePath), $"PackageA_x64 payload should not be there on test start: {packageA64SourceCodeFilePath}"); | ||
28 | |||
29 | multipleBundlePackagesBundle.Install(); | ||
30 | multipleBundlePackagesBundle.VerifyRegisteredAndInPackageCache(); | ||
31 | |||
32 | bundleA.VerifyRegisteredAndInPackageCache(); | ||
33 | bundleB_x64.VerifyRegisteredAndInPackageCache(); | ||
34 | |||
35 | // Source file should be installed | ||
36 | Assert.True(File.Exists(packageA32SourceCodeFilePath), $"Should have found PackageA payload installed at: {packageA32SourceCodeFilePath}"); | ||
37 | Assert.True(File.Exists(packageA64SourceCodeFilePath), $"Should have found PackageA_x64 payload installed at: {packageA64SourceCodeFilePath}"); | ||
38 | |||
39 | multipleBundlePackagesBundle.Uninstall(); | ||
40 | multipleBundlePackagesBundle.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
41 | |||
42 | bundleA.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
43 | bundleB_x64.VerifyUnregisteredAndRemovedFromPackageCache(); | ||
44 | |||
45 | // Source file should *not* be installed | ||
46 | Assert.False(File.Exists(packageA32SourceCodeFilePath), $"PackageA payload should have been removed by uninstall from: {packageA32SourceCodeFilePath}"); | ||
47 | Assert.False(File.Exists(packageA64SourceCodeFilePath), $"PackageA_x64 payload should have been removed by uninstall from: {packageA64SourceCodeFilePath}"); | ||
48 | |||
49 | } | ||
50 | } | ||
51 | } | ||