diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2020-06-19 13:52:20 +1000 |
---|---|---|
committer | Sean Hall <r.sean.hall@gmail.com> | 2020-06-19 14:07:03 +1000 |
commit | abff61df823505abc01776cec7b207501c671bf2 (patch) | |
tree | df1358638c44accce92d8a1a2da9e5795d8d231d /src/test | |
parent | 40d7700f0c5f6464f9491bf60d9d8604a81b7466 (diff) | |
download | wix-abff61df823505abc01776cec7b207501c671bf2.tar.gz wix-abff61df823505abc01776cec7b207501c671bf2.tar.bz2 wix-abff61df823505abc01776cec7b207501c671bf2.zip |
Implement BundleCustomData. Remove Unreal from CustomTable.
Diffstat (limited to 'src/test')
4 files changed, 80 insertions, 65 deletions
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs index 4b1ec718..ae83150a 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleManifestFixture.cs | |||
@@ -13,7 +13,7 @@ namespace WixToolsetTest.CoreIntegration | |||
13 | public class BundleManifestFixture | 13 | public class BundleManifestFixture |
14 | { | 14 | { |
15 | [Fact] | 15 | [Fact] |
16 | public void PopulatesBAManifestWithUnrealCustomTable() | 16 | public void PopulatesBAManifestWithBootstrapperApplicationBundleCustomData() |
17 | { | 17 | { |
18 | var folder = TestData.Get(@"TestData"); | 18 | var folder = TestData.Get(@"TestData"); |
19 | 19 | ||
@@ -43,11 +43,50 @@ namespace WixToolsetTest.CoreIntegration | |||
43 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | 43 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); |
44 | extractResult.AssertSuccess(); | 44 | extractResult.AssertSuccess(); |
45 | 45 | ||
46 | var customElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:BundleCustomTable"); | 46 | var customElements = extractResult.SelectBADataNodes("/ba:BootstrapperApplicationData/ba:BundleCustomTableBA"); |
47 | Assert.Equal(3, customElements.Count); | 47 | Assert.Equal(3, customElements.Count); |
48 | Assert.Equal("<BundleCustomTable Id='one' Column2='two' />", customElements[0].GetTestXml()); | 48 | Assert.Equal("<BundleCustomTableBA Id='one' Column2='two' />", customElements[0].GetTestXml()); |
49 | Assert.Equal("<BundleCustomTable Id='>' Column2='<' />", customElements[1].GetTestXml()); | 49 | Assert.Equal("<BundleCustomTableBA Id='>' Column2='<' />", customElements[1].GetTestXml()); |
50 | Assert.Equal("<BundleCustomTable Id='1' Column2='2' />", customElements[2].GetTestXml()); | 50 | Assert.Equal("<BundleCustomTableBA Id='1' Column2='2' />", customElements[2].GetTestXml()); |
51 | } | ||
52 | } | ||
53 | |||
54 | [Fact] | ||
55 | public void PopulatesBEManifestWithBundleExtensionBundleCustomData() | ||
56 | { | ||
57 | var folder = TestData.Get(@"TestData"); | ||
58 | |||
59 | using (var fs = new DisposableFileSystem()) | ||
60 | { | ||
61 | var baseFolder = fs.GetFolder(); | ||
62 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
63 | var bundlePath = Path.Combine(baseFolder, @"bin\test.exe"); | ||
64 | var baFolderPath = Path.Combine(baseFolder, "ba"); | ||
65 | var extractFolderPath = Path.Combine(baseFolder, "extract"); | ||
66 | |||
67 | var result = WixRunner.Execute(new[] | ||
68 | { | ||
69 | "build", | ||
70 | Path.Combine(folder, "BundleCustomTable", "BundleCustomTable.wxs"), | ||
71 | Path.Combine(folder, "BundleWithPackageGroupRef", "MinimalPackageGroup.wxs"), | ||
72 | Path.Combine(folder, "BundleWithPackageGroupRef", "Bundle.wxs"), | ||
73 | "-bindpath", Path.Combine(folder, "SimpleBundle", "data"), | ||
74 | "-intermediateFolder", intermediateFolder, | ||
75 | "-o", bundlePath | ||
76 | }); | ||
77 | |||
78 | result.AssertSuccess(); | ||
79 | |||
80 | Assert.True(File.Exists(bundlePath)); | ||
81 | |||
82 | var extractResult = BundleExtractor.ExtractBAContainer(null, bundlePath, baFolderPath, extractFolderPath); | ||
83 | extractResult.AssertSuccess(); | ||
84 | |||
85 | var customElements = extractResult.SelectBundleExtensionDataNodes("/be:BundleExtensionData/be:BundleExtension[@Id='CustomTableExtension']/be:BundleCustomTableBE"); | ||
86 | Assert.Equal(3, customElements.Count); | ||
87 | Assert.Equal("<BundleCustomTableBE Id='one' Column2='two' />", customElements[0].GetTestXml()); | ||
88 | Assert.Equal("<BundleCustomTableBE Id='>' Column2='<' />", customElements[1].GetTestXml()); | ||
89 | Assert.Equal("<BundleCustomTableBE Id='1' Column2='2' />", customElements[2].GetTestXml()); | ||
51 | } | 90 | } |
52 | } | 91 | } |
53 | 92 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs b/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs index 85a0ffae..afba1cbc 100644 --- a/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/CustomTableFixture.cs | |||
@@ -3,7 +3,6 @@ | |||
3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
4 | { | 4 | { |
5 | using System.IO; | 5 | using System.IO; |
6 | using Microsoft.Build.Tasks; | ||
7 | using WixBuildTools.TestSupport; | 6 | using WixBuildTools.TestSupport; |
8 | using WixToolset.Core.TestPackage; | 7 | using WixToolset.Core.TestPackage; |
9 | using Xunit; | 8 | using Xunit; |
@@ -160,36 +159,6 @@ namespace WixToolsetTest.CoreIntegration | |||
160 | } | 159 | } |
161 | 160 | ||
162 | [Fact] | 161 | [Fact] |
163 | public void UnrealCustomTableIsNotPresentInMsi() | ||
164 | { | ||
165 | var folder = TestData.Get(@"TestData"); | ||
166 | |||
167 | using (var fs = new DisposableFileSystem()) | ||
168 | { | ||
169 | var baseFolder = fs.GetFolder(); | ||
170 | var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
171 | var msiPath = Path.Combine(baseFolder, @"bin\test.msi"); | ||
172 | |||
173 | var result = WixRunner.Execute(new[] | ||
174 | { | ||
175 | "build", | ||
176 | Path.Combine(folder, "CustomTable", "CustomTable.wxs"), | ||
177 | Path.Combine(folder, "ProductWithComponentGroupRef", "MinimalComponentGroup.wxs"), | ||
178 | Path.Combine(folder, "ProductWithComponentGroupRef", "Product.wxs"), | ||
179 | "-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
180 | "-intermediateFolder", intermediateFolder, | ||
181 | "-o", msiPath | ||
182 | }); | ||
183 | |||
184 | result.AssertSuccess(); | ||
185 | |||
186 | Assert.True(File.Exists(msiPath)); | ||
187 | var results = Query.QueryDatabase(msiPath, new[] { "CustomTable2" }); | ||
188 | Assert.Empty(results); | ||
189 | } | ||
190 | } | ||
191 | |||
192 | [Fact] | ||
193 | public void CanCompileAndDecompile() | 162 | public void CanCompileAndDecompile() |
194 | { | 163 | { |
195 | var folder = TestData.Get(@"TestData"); | 164 | var folder = TestData.Get(@"TestData"); |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/BundleCustomTable/BundleCustomTable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleCustomTable/BundleCustomTable.wxs index dacbc014..38d207ca 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/BundleCustomTable/BundleCustomTable.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/BundleCustomTable/BundleCustomTable.wxs | |||
@@ -5,22 +5,42 @@ | |||
5 | <PackageGroupRef Id="MinimalPackageGroup" /> | 5 | <PackageGroupRef Id="MinimalPackageGroup" /> |
6 | </PackageGroup> | 6 | </PackageGroup> |
7 | 7 | ||
8 | <CustomTable Id="BundleCustomTable" Unreal="yes"> | 8 | <BundleCustomData Id="BundleCustomTableBA" Type="bootstrapperApplication"> |
9 | <Column Id="Id" Type="string" PrimaryKey="yes" /> | 9 | <BundleAttributeDefinition Id="Id" /> |
10 | <Column Id="Column2" Type="string" PrimaryKey="yes" /> | 10 | <BundleAttributeDefinition Id="Column2" /> |
11 | 11 | ||
12 | <Row> | 12 | <BundleElement> |
13 | <Data Column="Id">one</Data> | 13 | <BundleAttribute Id="Id">one</BundleAttribute> |
14 | <Data Column="Column2">two</Data> | 14 | <BundleAttribute Id="Column2">two</BundleAttribute> |
15 | </Row> | 15 | </BundleElement> |
16 | <Row> | 16 | <BundleElement> |
17 | <Data Column="Column2"><</Data> | 17 | <BundleAttribute Id="Column2"><</BundleAttribute> |
18 | <Data Column="Id">></Data> | 18 | <BundleAttribute Id="Id">></BundleAttribute> |
19 | </Row> | 19 | </BundleElement> |
20 | <Row> | 20 | <BundleElement> |
21 | <Data Column="Id">1</Data> | 21 | <BundleAttribute Id="Id">1</BundleAttribute> |
22 | <Data Column="Column2">2</Data> | 22 | <BundleAttribute Id="Column2">2</BundleAttribute> |
23 | </Row> | 23 | </BundleElement> |
24 | </CustomTable> | 24 | </BundleCustomData> |
25 | |||
26 | <BundleCustomData Id="BundleCustomTableBE" Type="bundleExtension" ExtensionId="CustomTableExtension"> | ||
27 | <BundleAttributeDefinition Id="Id" /> | ||
28 | <BundleAttributeDefinition Id="Column2" /> | ||
29 | |||
30 | <BundleElement> | ||
31 | <BundleAttribute Id="Id">one</BundleAttribute> | ||
32 | <BundleAttribute Id="Column2">two</BundleAttribute> | ||
33 | </BundleElement> | ||
34 | <BundleElement> | ||
35 | <BundleAttribute Id="Column2"><</BundleAttribute> | ||
36 | <BundleAttribute Id="Id">></BundleAttribute> | ||
37 | </BundleElement> | ||
38 | <BundleElement> | ||
39 | <BundleAttribute Id="Id">1</BundleAttribute> | ||
40 | <BundleAttribute Id="Column2">2</BundleAttribute> | ||
41 | </BundleElement> | ||
42 | </BundleCustomData> | ||
43 | |||
44 | <BundleExtension Id="CustomTableExtension" SourceFile="fakeba.dll" /> | ||
25 | </Fragment> | 45 | </Fragment> |
26 | </Wix> | 46 | </Wix> |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs index 51aee5f2..d6a2521e 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomTable/CustomTable.wxs | |||
@@ -17,18 +17,5 @@ | |||
17 | <Data Column="Component_">test.txt</Data> | 17 | <Data Column="Component_">test.txt</Data> |
18 | </Row> | 18 | </Row> |
19 | </CustomTable> | 19 | </CustomTable> |
20 | |||
21 | <CustomTable Id="CustomTable2" Unreal="yes"> | ||
22 | <Column Id="ColumnA" Type="string" PrimaryKey="yes" /> | ||
23 | <Column Id="Component_" Type="string" Width="72" KeyTable="Component" KeyColumn="1" /> | ||
24 | <Row> | ||
25 | <Data Column="ColumnA">RowA</Data> | ||
26 | <Data Column="Component_">test.txt</Data> | ||
27 | </Row> | ||
28 | <Row> | ||
29 | <Data Column="ColumnA">RowB</Data> | ||
30 | <Data Column="Component_">test.txt</Data> | ||
31 | </Row> | ||
32 | </CustomTable> | ||
33 | </Fragment> | 20 | </Fragment> |
34 | </Wix> | 21 | </Wix> |