From 87ffd980dc518a7ab40901eeae27b75259ea32b0 Mon Sep 17 00:00:00 2001 From: Sean Hall Date: Tue, 30 Mar 2021 21:51:33 -0500 Subject: Add failing test for DownloadUrl placeholder replacement. --- .../PayloadFixture.cs | 61 ++++++++++++++++++++++ .../Payload/DownloadUrlPlaceholdersBundle.wxs | 30 +++++++++++ 2 files changed, 91 insertions(+) create mode 100644 src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs (limited to 'src/test') diff --git a/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs b/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs index 5b6bbeb5..9bd33eac 100644 --- a/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs @@ -6,6 +6,7 @@ namespace WixToolsetTest.CoreIntegration using System.Collections.Generic; using System.IO; using System.Linq; + using System.Xml; using WixBuildTools.TestSupport; using WixToolset.Core.TestPackage; using WixToolset.Data; @@ -141,5 +142,65 @@ namespace WixToolsetTest.CoreIntegration Assert.InRange(result.ExitCode, 2, int.MaxValue); } } + + [Fact(Skip = "Test demonstrates failure")] + public void ReplacesDownloadUrlPlaceholders() + { + var folder = TestData.Get(@"TestData"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var intermediateFolder = Path.Combine(baseFolder, "obj"); + var bundlePath = Path.Combine(baseFolder, @"bin\test.exe"); + var baFolderPath = Path.Combine(baseFolder, "ba"); + var extractFolderPath = Path.Combine(baseFolder, "extract"); + + var result = WixRunner.Execute(new[] + { + "build", + Path.Combine(folder, "Payload", "DownloadUrlPlaceholdersBundle.wxs"), + Path.Combine(folder, "SimpleBundle", "MultiFileBootstrapperApplication.wxs"), + "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), + "-bindpath", Path.Combine(folder, ".Data"), + "-intermediateFolder", intermediateFolder, + "-o", bundlePath, + }); + + result.AssertSuccess(); + + Assert.True(File.Exists(bundlePath)); + + var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); + extractResult.AssertSuccess(); + + var ignoreAttributesByElementName = new Dictionary> + { + { "Container", new List { "FileSize", "Hash" } }, + { "Payload", new List { "FileSize", "Hash" } }, + }; + var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload") + .Cast() + .Select(e => e.GetTestXml(ignoreAttributesByElementName)) + .ToArray(); + WixAssert.CompareLineByLine(new string[] + { + "", + "", + "", + @"", + @"", + }, payloads); + + var containers = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Container") + .Cast() + .Select(e => e.GetTestXml(ignoreAttributesByElementName)) + .ToArray(); + WixAssert.CompareLineByLine(new string[] + { + "", + }, containers); + } + } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs new file mode 100644 index 00000000..87bb79f9 --- /dev/null +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/Payload/DownloadUrlPlaceholdersBundle.wxs @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + -- cgit v1.2.3-55-g6feb