aboutsummaryrefslogtreecommitdiff
path: root/src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs
diff options
context:
space:
mode:
authorSean Hall <r.sean.hall@gmail.com>2021-03-30 21:51:33 -0500
committerSean Hall <r.sean.hall@gmail.com>2021-03-30 22:05:07 -0500
commit87ffd980dc518a7ab40901eeae27b75259ea32b0 (patch)
tree32e2d3ce966d0017c1ce86a83f21329417411406 /src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs
parentf533d01010a3e5d8a93b4be1e1820e4668542a3a (diff)
downloadwix-87ffd980dc518a7ab40901eeae27b75259ea32b0.tar.gz
wix-87ffd980dc518a7ab40901eeae27b75259ea32b0.tar.bz2
wix-87ffd980dc518a7ab40901eeae27b75259ea32b0.zip
Add failing test for DownloadUrl placeholder replacement.
Diffstat (limited to 'src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs')
-rw-r--r--src/test/WixToolsetTest.CoreIntegration/PayloadFixture.cs61
1 files changed, 61 insertions, 0 deletions
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
6 using System.Collections.Generic; 6 using System.Collections.Generic;
7 using System.IO; 7 using System.IO;
8 using System.Linq; 8 using System.Linq;
9 using System.Xml;
9 using WixBuildTools.TestSupport; 10 using WixBuildTools.TestSupport;
10 using WixToolset.Core.TestPackage; 11 using WixToolset.Core.TestPackage;
11 using WixToolset.Data; 12 using WixToolset.Data;
@@ -141,5 +142,65 @@ namespace WixToolsetTest.CoreIntegration
141 Assert.InRange(result.ExitCode, 2, int.MaxValue); 142 Assert.InRange(result.ExitCode, 2, int.MaxValue);
142 } 143 }
143 } 144 }
145
146 [Fact(Skip = "Test demonstrates failure")]
147 public void ReplacesDownloadUrlPlaceholders()
148 {
149 var folder = TestData.Get(@"TestData");
150
151 using (var fs = new DisposableFileSystem())
152 {
153 var baseFolder = fs.GetFolder();
154 var intermediateFolder = Path.Combine(baseFolder, "obj");
155 var bundlePath = Path.Combine(baseFolder, @"bin\test.exe");
156 var baFolderPath = Path.Combine(baseFolder, "ba");
157 var extractFolderPath = Path.Combine(baseFolder, "extract");
158
159 var result = WixRunner.Execute(new[]
160 {
161 "build",
162 Path.Combine(folder, "Payload", "DownloadUrlPlaceholdersBundle.wxs"),
163 Path.Combine(folder, "SimpleBundle", "MultiFileBootstrapperApplication.wxs"),
164 "-bindpath", Path.Combine(folder, "SimpleBundle", "data"),
165 "-bindpath", Path.Combine(folder, ".Data"),
166 "-intermediateFolder", intermediateFolder,
167 "-o", bundlePath,
168 });
169
170 result.AssertSuccess();
171
172 Assert.True(File.Exists(bundlePath));
173
174 var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath);
175 extractResult.AssertSuccess();
176
177 var ignoreAttributesByElementName = new Dictionary<string, List<string>>
178 {
179 { "Container", new List<string> { "FileSize", "Hash" } },
180 { "Payload", new List<string> { "FileSize", "Hash" } },
181 };
182 var payloads = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Payload")
183 .Cast<XmlElement>()
184 .Select(e => e.GetTestXml(ignoreAttributesByElementName))
185 .ToArray();
186 WixAssert.CompareLineByLine(new string[]
187 {
188 "<Payload Id='burn.exe' FilePath='burn.exe' FileSize='*' Hash='*' Packaging='embedded' SourcePath='a0' Container='PackagesContainer' />",
189 "<Payload Id='test.msi' FilePath='test.msi' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/test.msi/test.msi' Packaging='external' SourcePath='test.msi' />",
190 "<Payload Id='LayoutOnlyPayload' FilePath='DownloadUrlPlaceholdersBundle.wxs' FileSize='*' Hash='*' LayoutOnly='yes' DownloadUrl='http://example.com/id/LayoutOnlyPayload/DownloadUrlPlaceholdersBundle.wxs' Packaging='external' SourcePath='DownloadUrlPlaceholdersBundle.wxs' />",
191 @"<Payload Id='fhuZsOcBDTuIX8rF96kswqI6SnuI' FilePath='MsiPackage\test.txt' FileSize='*' Hash='*' Packaging='external' SourcePath='MsiPackage\test.txt' />",
192 @"<Payload Id='faf_OZ741BG7SJ6ZkcIvivZ2Yzo8' FilePath='MsiPackage\Shared.dll' FileSize='*' Hash='*' Packaging='external' SourcePath='MsiPackage\Shared.dll' />",
193 }, payloads);
194
195 var containers = extractResult.SelectManifestNodes("/burn:BurnManifest/burn:Container")
196 .Cast<XmlElement>()
197 .Select(e => e.GetTestXml(ignoreAttributesByElementName))
198 .ToArray();
199 WixAssert.CompareLineByLine(new string[]
200 {
201 "<Container Id='PackagesContainer' FileSize='*' Hash='*' DownloadUrl='http://example.com/id/PackagesContainer/packages.cab' FilePath='packages.cab' />",
202 }, containers);
203 }
204 }
144 } 205 }
145} 206}