diff options
author | Rob Mensching <rob@firegiant.com> | 2020-06-26 13:52:38 -0700 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2020-06-26 14:06:56 -0700 |
commit | 0eec58b87b3aeb73758f8bb581244e291631d767 (patch) | |
tree | 0378090af0f08bb075c3e62751159b5d214e6caa /src | |
parent | 026c2fdb94a0333bfb840decee9464ba2f839705 (diff) | |
download | wix-0eec58b87b3aeb73758f8bb581244e291631d767.tar.gz wix-0eec58b87b3aeb73758f8bb581244e291631d767.tar.bz2 wix-0eec58b87b3aeb73758f8bb581244e291631d767.zip |
Skip v3 conversions when re-converting v4 code
Rename Wix3Converter to WixConverter as the class is used for all
conversions.
Diffstat (limited to 'src')
-rw-r--r-- | src/WixToolset.Converters/ConvertCommand.cs | 4 | ||||
-rw-r--r-- | src/WixToolset.Converters/WixConverter.cs (renamed from src/WixToolset.Converters/Wix3Converter.cs) | 119 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/ConditionFixture.cs | 10 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/ConverterFixture.cs | 28 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | 6 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/CustomActionFixture.cs | 4 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/CustomTableFixture.cs | 10 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/PropertyFixture.cs | 6 | ||||
-rw-r--r-- | src/test/WixToolsetTest.Converters/SequenceFixture.cs | 2 |
9 files changed, 107 insertions, 82 deletions
diff --git a/src/WixToolset.Converters/ConvertCommand.cs b/src/WixToolset.Converters/ConvertCommand.cs index 139b5813..51e7b997 100644 --- a/src/WixToolset.Converters/ConvertCommand.cs +++ b/src/WixToolset.Converters/ConvertCommand.cs | |||
@@ -133,7 +133,7 @@ namespace WixToolset.Converters | |||
133 | } | 133 | } |
134 | } | 134 | } |
135 | 135 | ||
136 | var converter = new Wix3Converter(this.Messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); | 136 | var converter = new WixConverter(this.Messaging, this.IndentationAmount, this.ErrorsAsWarnings, this.IgnoreErrors); |
137 | 137 | ||
138 | var errors = this.InspectSubDirectories(converter, Path.GetFullPath("."), cancellationToken); | 138 | var errors = this.InspectSubDirectories(converter, Path.GetFullPath("."), cancellationToken); |
139 | 139 | ||
@@ -204,7 +204,7 @@ namespace WixToolset.Converters | |||
204 | /// </summary> | 204 | /// </summary> |
205 | /// <param name="directory">The directory whose sub-directories will be inspected.</param> | 205 | /// <param name="directory">The directory whose sub-directories will be inspected.</param> |
206 | /// <returns>The number of errors that were found.</returns> | 206 | /// <returns>The number of errors that were found.</returns> |
207 | private int InspectSubDirectories(Wix3Converter converter, string directory, CancellationToken cancellationToken) | 207 | private int InspectSubDirectories(WixConverter converter, string directory, CancellationToken cancellationToken) |
208 | { | 208 | { |
209 | var errors = 0; | 209 | var errors = 0; |
210 | 210 | ||
diff --git a/src/WixToolset.Converters/Wix3Converter.cs b/src/WixToolset.Converters/WixConverter.cs index 8c7d2049..a89d44ce 100644 --- a/src/WixToolset.Converters/Wix3Converter.cs +++ b/src/WixToolset.Converters/WixConverter.cs | |||
@@ -17,7 +17,7 @@ namespace WixToolset.Converters | |||
17 | /// <summary> | 17 | /// <summary> |
18 | /// WiX source code converter. | 18 | /// WiX source code converter. |
19 | /// </summary> | 19 | /// </summary> |
20 | public class Wix3Converter | 20 | public class WixConverter |
21 | { | 21 | { |
22 | private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); | 22 | private static readonly Regex AddPrefix = new Regex(@"^[^a-zA-Z_]", RegexOptions.Compiled); |
23 | private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters | 23 | private static readonly Regex IllegalIdentifierCharacters = new Regex(@"[^A-Za-z0-9_\.]|\.{2,}", RegexOptions.Compiled); // non 'words' and assorted valid characters |
@@ -98,6 +98,18 @@ namespace WixToolset.Converters | |||
98 | { "http://schemas.microsoft.com/wix/2006/WixUnit", "http://wixtoolset.org/schemas/v4/wixunit" }, | 98 | { "http://schemas.microsoft.com/wix/2006/WixUnit", "http://wixtoolset.org/schemas/v4/wixunit" }, |
99 | }; | 99 | }; |
100 | 100 | ||
101 | private readonly static SortedSet<string> Wix3Namespaces = new SortedSet<string> | ||
102 | { | ||
103 | "http://schemas.microsoft.com/wix/2006/wi", | ||
104 | "http://schemas.microsoft.com/wix/2006/localization", | ||
105 | }; | ||
106 | |||
107 | private readonly static SortedSet<string> Wix4Namespaces = new SortedSet<string> | ||
108 | { | ||
109 | "http://wixtoolset.org/schemas/v4/wxs", | ||
110 | "http://wixtoolset.org/schemas/v4/wxl", | ||
111 | }; | ||
112 | |||
101 | private readonly Dictionary<XName, Action<XElement>> ConvertElementMapping; | 113 | private readonly Dictionary<XName, Action<XElement>> ConvertElementMapping; |
102 | 114 | ||
103 | /// <summary> | 115 | /// <summary> |
@@ -106,48 +118,48 @@ namespace WixToolset.Converters | |||
106 | /// <param name="indentationAmount">Indentation value to use when validating leading whitespace.</param> | 118 | /// <param name="indentationAmount">Indentation value to use when validating leading whitespace.</param> |
107 | /// <param name="errorsAsWarnings">Test errors to display as warnings.</param> | 119 | /// <param name="errorsAsWarnings">Test errors to display as warnings.</param> |
108 | /// <param name="ignoreErrors">Test errors to ignore.</param> | 120 | /// <param name="ignoreErrors">Test errors to ignore.</param> |
109 | public Wix3Converter(IMessaging messaging, int indentationAmount, IEnumerable<string> errorsAsWarnings = null, IEnumerable<string> ignoreErrors = null) | 121 | public WixConverter(IMessaging messaging, int indentationAmount, IEnumerable<string> errorsAsWarnings = null, IEnumerable<string> ignoreErrors = null) |
110 | { | 122 | { |
111 | this.ConvertElementMapping = new Dictionary<XName, Action<XElement>> | 123 | this.ConvertElementMapping = new Dictionary<XName, Action<XElement>> |
112 | { | 124 | { |
113 | { Wix3Converter.AdminExecuteSequenceElementName, this.ConvertSequenceElement }, | 125 | { WixConverter.AdminExecuteSequenceElementName, this.ConvertSequenceElement }, |
114 | { Wix3Converter.AdminUISequenceSequenceElementName, this.ConvertSequenceElement }, | 126 | { WixConverter.AdminUISequenceSequenceElementName, this.ConvertSequenceElement }, |
115 | { Wix3Converter.AdvertiseExecuteSequenceElementName, this.ConvertSequenceElement }, | 127 | { WixConverter.AdvertiseExecuteSequenceElementName, this.ConvertSequenceElement }, |
116 | { Wix3Converter.InstallUISequenceSequenceElementName, this.ConvertSequenceElement }, | 128 | { WixConverter.InstallUISequenceSequenceElementName, this.ConvertSequenceElement }, |
117 | { Wix3Converter.InstallExecuteSequenceElementName, this.ConvertSequenceElement }, | 129 | { WixConverter.InstallExecuteSequenceElementName, this.ConvertSequenceElement }, |
118 | { Wix3Converter.ColumnElementName, this.ConvertColumnElement }, | 130 | { WixConverter.ColumnElementName, this.ConvertColumnElement }, |
119 | { Wix3Converter.CustomTableElementName, this.ConvertCustomTableElement }, | 131 | { WixConverter.CustomTableElementName, this.ConvertCustomTableElement }, |
120 | { Wix3Converter.ControlElementName, this.ConvertControlElement }, | 132 | { WixConverter.ControlElementName, this.ConvertControlElement }, |
121 | { Wix3Converter.ComponentElementName, this.ConvertComponentElement }, | 133 | { WixConverter.ComponentElementName, this.ConvertComponentElement }, |
122 | { Wix3Converter.DirectoryElementName, this.ConvertDirectoryElement }, | 134 | { WixConverter.DirectoryElementName, this.ConvertDirectoryElement }, |
123 | { Wix3Converter.FeatureElementName, this.ConvertFeatureElement }, | 135 | { WixConverter.FeatureElementName, this.ConvertFeatureElement }, |
124 | { Wix3Converter.FileElementName, this.ConvertFileElement }, | 136 | { WixConverter.FileElementName, this.ConvertFileElement }, |
125 | { Wix3Converter.FragmentElementName, this.ConvertFragmentElement }, | 137 | { WixConverter.FragmentElementName, this.ConvertFragmentElement }, |
126 | { Wix3Converter.EmbeddedChainerElementName, this.ConvertEmbeddedChainerElement }, | 138 | { WixConverter.EmbeddedChainerElementName, this.ConvertEmbeddedChainerElement }, |
127 | { Wix3Converter.ErrorElementName, this.ConvertErrorElement }, | 139 | { WixConverter.ErrorElementName, this.ConvertErrorElement }, |
128 | { Wix3Converter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, | 140 | { WixConverter.ExePackageElementName, this.ConvertSuppressSignatureValidation }, |
129 | { Wix3Converter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, | 141 | { WixConverter.MsiPackageElementName, this.ConvertSuppressSignatureValidation }, |
130 | { Wix3Converter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, | 142 | { WixConverter.MspPackageElementName, this.ConvertSuppressSignatureValidation }, |
131 | { Wix3Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, | 143 | { WixConverter.MsuPackageElementName, this.ConvertSuppressSignatureValidation }, |
132 | { Wix3Converter.PayloadElementName, this.ConvertSuppressSignatureValidation }, | 144 | { WixConverter.PayloadElementName, this.ConvertSuppressSignatureValidation }, |
133 | { Wix3Converter.PermissionExElementName, this.ConvertPermissionExElement }, | 145 | { WixConverter.PermissionExElementName, this.ConvertPermissionExElement }, |
134 | { Wix3Converter.ProductElementName, this.ConvertProductElement }, | 146 | { WixConverter.ProductElementName, this.ConvertProductElement }, |
135 | { Wix3Converter.ProgressTextElementName, this.ConvertProgressTextElement }, | 147 | { WixConverter.ProgressTextElementName, this.ConvertProgressTextElement }, |
136 | { Wix3Converter.PublishElementName, this.ConvertPublishElement }, | 148 | { WixConverter.PublishElementName, this.ConvertPublishElement }, |
137 | { Wix3Converter.MultiStringValueElementName, this.ConvertMultiStringValueElement }, | 149 | { WixConverter.MultiStringValueElementName, this.ConvertMultiStringValueElement }, |
138 | { Wix3Converter.RequiredPrivilegeElementName, this.ConvertRequiredPrivilegeElement }, | 150 | { WixConverter.RequiredPrivilegeElementName, this.ConvertRequiredPrivilegeElement }, |
139 | { Wix3Converter.RowElementName, this.ConvertRowElement }, | 151 | { WixConverter.RowElementName, this.ConvertRowElement }, |
140 | { Wix3Converter.CustomActionElementName, this.ConvertCustomActionElement }, | 152 | { WixConverter.CustomActionElementName, this.ConvertCustomActionElement }, |
141 | { Wix3Converter.ServiceArgumentElementName, this.ConvertServiceArgumentElement }, | 153 | { WixConverter.ServiceArgumentElementName, this.ConvertServiceArgumentElement }, |
142 | { Wix3Converter.SetDirectoryElementName, this.ConvertSetDirectoryElement }, | 154 | { WixConverter.SetDirectoryElementName, this.ConvertSetDirectoryElement }, |
143 | { Wix3Converter.SetPropertyElementName, this.ConvertSetPropertyElement }, | 155 | { WixConverter.SetPropertyElementName, this.ConvertSetPropertyElement }, |
144 | { Wix3Converter.ShortcutPropertyElementName, this.ConvertShortcutPropertyElement }, | 156 | { WixConverter.ShortcutPropertyElementName, this.ConvertShortcutPropertyElement }, |
145 | { Wix3Converter.TextElementName, this.ConvertTextElement }, | 157 | { WixConverter.TextElementName, this.ConvertTextElement }, |
146 | { Wix3Converter.UITextElementName, this.ConvertUITextElement }, | 158 | { WixConverter.UITextElementName, this.ConvertUITextElement }, |
147 | { Wix3Converter.UtilPermissionExElementName, this.ConvertUtilPermissionExElement }, | 159 | { WixConverter.UtilPermissionExElementName, this.ConvertUtilPermissionExElement }, |
148 | { Wix3Converter.PropertyElementName, this.ConvertPropertyElement }, | 160 | { WixConverter.PropertyElementName, this.ConvertPropertyElement }, |
149 | { Wix3Converter.WixElementWithoutNamespaceName, this.ConvertElementWithoutNamespace }, | 161 | { WixConverter.WixElementWithoutNamespaceName, this.ConvertElementWithoutNamespace }, |
150 | { Wix3Converter.IncludeElementWithoutNamespaceName, this.ConvertElementWithoutNamespace }, | 162 | { WixConverter.IncludeElementWithoutNamespaceName, this.ConvertElementWithoutNamespace }, |
151 | }; | 163 | }; |
152 | 164 | ||
153 | this.Messaging = messaging; | 165 | this.Messaging = messaging; |
@@ -171,6 +183,8 @@ namespace WixToolset.Converters | |||
171 | 183 | ||
172 | private string SourceFile { get; set; } | 184 | private string SourceFile { get; set; } |
173 | 185 | ||
186 | private int SourceVersion { get; set; } | ||
187 | |||
174 | /// <summary> | 188 | /// <summary> |
175 | /// Convert a file. | 189 | /// Convert a file. |
176 | /// </summary> | 190 | /// </summary> |
@@ -184,6 +198,7 @@ namespace WixToolset.Converters | |||
184 | // Set the instance info. | 198 | // Set the instance info. |
185 | this.Errors = 0; | 199 | this.Errors = 0; |
186 | this.SourceFile = sourceFile; | 200 | this.SourceFile = sourceFile; |
201 | this.SourceVersion = 0; | ||
187 | 202 | ||
188 | try | 203 | try |
189 | { | 204 | { |
@@ -225,6 +240,7 @@ namespace WixToolset.Converters | |||
225 | public int ConvertDocument(XDocument document) | 240 | public int ConvertDocument(XDocument document) |
226 | { | 241 | { |
227 | this.Errors = 0; | 242 | this.Errors = 0; |
243 | this.SourceVersion = 0; | ||
228 | 244 | ||
229 | var declaration = document.Declaration; | 245 | var declaration = document.Declaration; |
230 | 246 | ||
@@ -292,13 +308,13 @@ namespace WixToolset.Converters | |||
292 | 308 | ||
293 | private void EnsurePrecedingWhitespaceCorrect(XText whitespace, XNode node, int level, ConverterTestType testType) | 309 | private void EnsurePrecedingWhitespaceCorrect(XText whitespace, XNode node, int level, ConverterTestType testType) |
294 | { | 310 | { |
295 | if (!Wix3Converter.LeadingWhitespaceValid(this.IndentationAmount, level, whitespace.Value)) | 311 | if (!WixConverter.LeadingWhitespaceValid(this.IndentationAmount, level, whitespace.Value)) |
296 | { | 312 | { |
297 | var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; | 313 | var message = testType == ConverterTestType.WhitespacePrecedingEndElementWrong ? "The whitespace preceding this end element is incorrect." : "The whitespace preceding this node is incorrect."; |
298 | 314 | ||
299 | if (this.OnError(testType, node, message)) | 315 | if (this.OnError(testType, node, message)) |
300 | { | 316 | { |
301 | Wix3Converter.FixupWhitespace(this.IndentationAmount, level, whitespace); | 317 | WixConverter.FixupWhitespace(this.IndentationAmount, level, whitespace); |
302 | } | 318 | } |
303 | } | 319 | } |
304 | } | 320 | } |
@@ -323,8 +339,17 @@ namespace WixToolset.Converters | |||
323 | 339 | ||
324 | foreach (var declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) | 340 | foreach (var declaration in element.Attributes().Where(a => a.IsNamespaceDeclaration)) |
325 | { | 341 | { |
326 | if (Wix3Converter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out var ns)) | 342 | if (WixConverter.OldToNewNamespaceMapping.TryGetValue(declaration.Value, out var ns)) |
327 | { | 343 | { |
344 | if (Wix3Namespaces.Contains(declaration.Value)) | ||
345 | { | ||
346 | this.SourceVersion = 3; | ||
347 | } | ||
348 | else if (Wix4Namespaces.Contains(declaration.Value)) | ||
349 | { | ||
350 | this.SourceVersion = 4; | ||
351 | } | ||
352 | |||
328 | if (this.OnError(ConverterTestType.XmlnsValueWrong, declaration, "The namespace '{0}' is out of date. It must be '{1}'.", declaration.Value, ns.NamespaceName)) | 353 | if (this.OnError(ConverterTestType.XmlnsValueWrong, declaration, "The namespace '{0}' is out of date. It must be '{1}'.", declaration.Value, ns.NamespaceName)) |
329 | { | 354 | { |
330 | deprecatedToUpdatedNamespaces.Add(declaration.Value, ns); | 355 | deprecatedToUpdatedNamespaces.Add(declaration.Value, ns); |
@@ -334,7 +359,7 @@ namespace WixToolset.Converters | |||
334 | 359 | ||
335 | if (deprecatedToUpdatedNamespaces.Any()) | 360 | if (deprecatedToUpdatedNamespaces.Any()) |
336 | { | 361 | { |
337 | Wix3Converter.UpdateElementsWithDeprecatedNamespaces(element.DescendantsAndSelf(), deprecatedToUpdatedNamespaces); | 362 | WixConverter.UpdateElementsWithDeprecatedNamespaces(element.DescendantsAndSelf(), deprecatedToUpdatedNamespaces); |
338 | } | 363 | } |
339 | 364 | ||
340 | // Apply any specialized conversion actions. | 365 | // Apply any specialized conversion actions. |
@@ -457,7 +482,7 @@ namespace WixToolset.Converters | |||
457 | 482 | ||
458 | private void ConvertFileElement(XElement element) | 483 | private void ConvertFileElement(XElement element) |
459 | { | 484 | { |
460 | if (null == element.Attribute("Id")) | 485 | if (this.SourceVersion < 4 && null == element.Attribute("Id")) |
461 | { | 486 | { |
462 | var attribute = element.Attribute("Name"); | 487 | var attribute = element.Attribute("Name"); |
463 | 488 | ||
@@ -470,7 +495,7 @@ namespace WixToolset.Converters | |||
470 | { | 495 | { |
471 | var name = Path.GetFileName(attribute.Value); | 496 | var name = Path.GetFileName(attribute.Value); |
472 | 497 | ||
473 | if (this.OnError(ConverterTestType.AssignAnonymousFileId, element, "The file id is being updated to '{0}' to ensure it remains the same as the default", name)) | 498 | if (this.OnError(ConverterTestType.AssignAnonymousFileId, element, "The file id is being updated to '{0}' to ensure it remains the same as the v3 default", name)) |
474 | { | 499 | { |
475 | IEnumerable<XAttribute> attributes = element.Attributes().ToList(); | 500 | IEnumerable<XAttribute> attributes = element.Attributes().ToList(); |
476 | element.RemoveAttributes(); | 501 | element.RemoveAttributes(); |
@@ -669,7 +694,7 @@ namespace WixToolset.Converters | |||
669 | 694 | ||
670 | private void ConvertUtilPermissionExElement(XElement element) | 695 | private void ConvertUtilPermissionExElement(XElement element) |
671 | { | 696 | { |
672 | if (null == element.Attribute("Inheritable")) | 697 | if (this.SourceVersion < 4 && null == element.Attribute("Inheritable")) |
673 | { | 698 | { |
674 | var inheritable = element.Parent.Name == CreateFolderElementName; | 699 | var inheritable = element.Parent.Name == CreateFolderElementName; |
675 | if (!inheritable) | 700 | if (!inheritable) |
diff --git a/src/test/WixToolsetTest.Converters/ConditionFixture.cs b/src/test/WixToolsetTest.Converters/ConditionFixture.cs index 804ebe5b..3fa7c031 100644 --- a/src/test/WixToolsetTest.Converters/ConditionFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConditionFixture.cs | |||
@@ -45,7 +45,7 @@ namespace WixToolsetTest.Converters | |||
45 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 45 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
46 | 46 | ||
47 | var messaging = new MockMessaging(); | 47 | var messaging = new MockMessaging(); |
48 | var converter = new Wix3Converter(messaging, 2, null, null); | 48 | var converter = new WixConverter(messaging, 2, null, null); |
49 | 49 | ||
50 | var errors = converter.ConvertDocument(document); | 50 | var errors = converter.ConvertDocument(document); |
51 | Assert.Equal(3, errors); | 51 | Assert.Equal(3, errors); |
@@ -81,7 +81,7 @@ namespace WixToolsetTest.Converters | |||
81 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 81 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
82 | 82 | ||
83 | var messaging = new MockMessaging(); | 83 | var messaging = new MockMessaging(); |
84 | var converter = new Wix3Converter(messaging, 2, null, null); | 84 | var converter = new WixConverter(messaging, 2, null, null); |
85 | 85 | ||
86 | var errors = converter.ConvertDocument(document); | 86 | var errors = converter.ConvertDocument(document); |
87 | Assert.Equal(3, errors); | 87 | Assert.Equal(3, errors); |
@@ -117,7 +117,7 @@ namespace WixToolsetTest.Converters | |||
117 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 117 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
118 | 118 | ||
119 | var messaging = new MockMessaging(); | 119 | var messaging = new MockMessaging(); |
120 | var converter = new Wix3Converter(messaging, 2, null, null); | 120 | var converter = new WixConverter(messaging, 2, null, null); |
121 | 121 | ||
122 | var errors = converter.ConvertDocument(document); | 122 | var errors = converter.ConvertDocument(document); |
123 | Assert.Equal(3, errors); | 123 | Assert.Equal(3, errors); |
@@ -151,7 +151,7 @@ namespace WixToolsetTest.Converters | |||
151 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 151 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
152 | 152 | ||
153 | var messaging = new MockMessaging(); | 153 | var messaging = new MockMessaging(); |
154 | var converter = new Wix3Converter(messaging, 2, null, null); | 154 | var converter = new WixConverter(messaging, 2, null, null); |
155 | 155 | ||
156 | var errors = converter.ConvertDocument(document); | 156 | var errors = converter.ConvertDocument(document); |
157 | Assert.Equal(3, errors); | 157 | Assert.Equal(3, errors); |
@@ -192,7 +192,7 @@ namespace WixToolsetTest.Converters | |||
192 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 192 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
193 | 193 | ||
194 | var messaging = new MockMessaging(); | 194 | var messaging = new MockMessaging(); |
195 | var converter = new Wix3Converter(messaging, 2, null, null); | 195 | var converter = new WixConverter(messaging, 2, null, null); |
196 | 196 | ||
197 | var errors = converter.ConvertDocument(document); | 197 | var errors = converter.ConvertDocument(document); |
198 | Assert.Equal(3, errors); | 198 | Assert.Equal(3, errors); |
diff --git a/src/test/WixToolsetTest.Converters/ConverterFixture.cs b/src/test/WixToolsetTest.Converters/ConverterFixture.cs index 10029090..c205df39 100644 --- a/src/test/WixToolsetTest.Converters/ConverterFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterFixture.cs | |||
@@ -29,7 +29,7 @@ namespace WixToolsetTest.Converters | |||
29 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 29 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
30 | 30 | ||
31 | var messaging = new MockMessaging(); | 31 | var messaging = new MockMessaging(); |
32 | var converter = new Wix3Converter(messaging, 2, null, null); | 32 | var converter = new WixConverter(messaging, 2, null, null); |
33 | 33 | ||
34 | var errors = converter.ConvertDocument(document); | 34 | var errors = converter.ConvertDocument(document); |
35 | 35 | ||
@@ -62,7 +62,7 @@ namespace WixToolsetTest.Converters | |||
62 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 62 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
63 | 63 | ||
64 | var messaging = new MockMessaging(); | 64 | var messaging = new MockMessaging(); |
65 | var converter = new Wix3Converter(messaging, 4, null, null); | 65 | var converter = new WixConverter(messaging, 4, null, null); |
66 | 66 | ||
67 | var errors = converter.ConvertDocument(document); | 67 | var errors = converter.ConvertDocument(document); |
68 | 68 | ||
@@ -97,7 +97,7 @@ namespace WixToolsetTest.Converters | |||
97 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 97 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
98 | 98 | ||
99 | var messaging = new MockMessaging(); | 99 | var messaging = new MockMessaging(); |
100 | var converter = new Wix3Converter(messaging, 4, null, null); | 100 | var converter = new WixConverter(messaging, 4, null, null); |
101 | 101 | ||
102 | var conversions = converter.ConvertDocument(document); | 102 | var conversions = converter.ConvertDocument(document); |
103 | 103 | ||
@@ -133,7 +133,7 @@ namespace WixToolsetTest.Converters | |||
133 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 133 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
134 | 134 | ||
135 | var messaging = new MockMessaging(); | 135 | var messaging = new MockMessaging(); |
136 | var converter = new Wix3Converter(messaging, 4, null, null); | 136 | var converter = new WixConverter(messaging, 4, null, null); |
137 | 137 | ||
138 | var conversions = converter.ConvertDocument(document); | 138 | var conversions = converter.ConvertDocument(document); |
139 | 139 | ||
@@ -160,7 +160,7 @@ namespace WixToolsetTest.Converters | |||
160 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 160 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
161 | 161 | ||
162 | var messaging = new MockMessaging(); | 162 | var messaging = new MockMessaging(); |
163 | var converter = new Wix3Converter(messaging, 2, null, null); | 163 | var converter = new WixConverter(messaging, 2, null, null); |
164 | 164 | ||
165 | var errors = converter.ConvertDocument(document); | 165 | var errors = converter.ConvertDocument(document); |
166 | 166 | ||
@@ -188,7 +188,7 @@ namespace WixToolsetTest.Converters | |||
188 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 188 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
189 | 189 | ||
190 | var messaging = new MockMessaging(); | 190 | var messaging = new MockMessaging(); |
191 | var converter = new Wix3Converter(messaging, 2, null, null); | 191 | var converter = new WixConverter(messaging, 2, null, null); |
192 | 192 | ||
193 | var errors = converter.ConvertDocument(document); | 193 | var errors = converter.ConvertDocument(document); |
194 | 194 | ||
@@ -220,7 +220,7 @@ namespace WixToolsetTest.Converters | |||
220 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 220 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
221 | 221 | ||
222 | var messaging = new MockMessaging(); | 222 | var messaging = new MockMessaging(); |
223 | var converter = new Wix3Converter(messaging, 2, null, null); | 223 | var converter = new WixConverter(messaging, 2, null, null); |
224 | 224 | ||
225 | var errors = converter.ConvertDocument(document); | 225 | var errors = converter.ConvertDocument(document); |
226 | 226 | ||
@@ -249,7 +249,7 @@ namespace WixToolsetTest.Converters | |||
249 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 249 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
250 | 250 | ||
251 | var messaging = new MockMessaging(); | 251 | var messaging = new MockMessaging(); |
252 | var converter = new Wix3Converter(messaging, 2, null, null); | 252 | var converter = new WixConverter(messaging, 2, null, null); |
253 | 253 | ||
254 | var errors = converter.ConvertDocument(document); | 254 | var errors = converter.ConvertDocument(document); |
255 | 255 | ||
@@ -277,7 +277,7 @@ namespace WixToolsetTest.Converters | |||
277 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 277 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
278 | 278 | ||
279 | var messaging = new MockMessaging(); | 279 | var messaging = new MockMessaging(); |
280 | var converter = new Wix3Converter(messaging, 2, null, null); | 280 | var converter = new WixConverter(messaging, 2, null, null); |
281 | 281 | ||
282 | var errors = converter.ConvertDocument(document); | 282 | var errors = converter.ConvertDocument(document); |
283 | 283 | ||
@@ -315,7 +315,7 @@ namespace WixToolsetTest.Converters | |||
315 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 315 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
316 | 316 | ||
317 | var messaging = new MockMessaging(); | 317 | var messaging = new MockMessaging(); |
318 | var converter = new Wix3Converter(messaging, 2, null, null); | 318 | var converter = new WixConverter(messaging, 2, null, null); |
319 | 319 | ||
320 | var errors = converter.ConvertDocument(document); | 320 | var errors = converter.ConvertDocument(document); |
321 | 321 | ||
@@ -343,7 +343,7 @@ namespace WixToolsetTest.Converters | |||
343 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 343 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
344 | 344 | ||
345 | var messaging = new MockMessaging(); | 345 | var messaging = new MockMessaging(); |
346 | var converter = new Wix3Converter(messaging, 2, null, null); | 346 | var converter = new WixConverter(messaging, 2, null, null); |
347 | 347 | ||
348 | var errors = converter.ConvertDocument(document); | 348 | var errors = converter.ConvertDocument(document); |
349 | 349 | ||
@@ -370,7 +370,7 @@ namespace WixToolsetTest.Converters | |||
370 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 370 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
371 | 371 | ||
372 | var messaging = new MockMessaging(); | 372 | var messaging = new MockMessaging(); |
373 | var converter = new Wix3Converter(messaging, 2, null, null); | 373 | var converter = new WixConverter(messaging, 2, null, null); |
374 | 374 | ||
375 | var errors = converter.ConvertDocument(document); | 375 | var errors = converter.ConvertDocument(document); |
376 | 376 | ||
@@ -396,7 +396,7 @@ namespace WixToolsetTest.Converters | |||
396 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 396 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
397 | 397 | ||
398 | var messaging = new MockMessaging(); | 398 | var messaging = new MockMessaging(); |
399 | var converter = new Wix3Converter(messaging, 2, null, null); | 399 | var converter = new WixConverter(messaging, 2, null, null); |
400 | 400 | ||
401 | var errors = converter.ConvertDocument(document); | 401 | var errors = converter.ConvertDocument(document); |
402 | 402 | ||
@@ -422,7 +422,7 @@ namespace WixToolsetTest.Converters | |||
422 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 422 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
423 | 423 | ||
424 | var messaging = new MockMessaging(); | 424 | var messaging = new MockMessaging(); |
425 | var converter = new Wix3Converter(messaging, 2, null, null); | 425 | var converter = new WixConverter(messaging, 2, null, null); |
426 | 426 | ||
427 | var errors = converter.ConvertDocument(document); | 427 | var errors = converter.ConvertDocument(document); |
428 | 428 | ||
diff --git a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs index d4fd1acf..5eaeb985 100644 --- a/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs +++ b/src/test/WixToolsetTest.Converters/ConverterIntegrationFixture.cs | |||
@@ -28,7 +28,7 @@ namespace WixToolsetTest.Converters | |||
28 | File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); | 28 | File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); |
29 | 29 | ||
30 | var messaging = new MockMessaging(); | 30 | var messaging = new MockMessaging(); |
31 | var converter = new Wix3Converter(messaging, 4); | 31 | var converter = new WixConverter(messaging, 4); |
32 | var errors = converter.ConvertFile(targetFile, true); | 32 | var errors = converter.ConvertFile(targetFile, true); |
33 | 33 | ||
34 | Assert.Equal(8, errors); | 34 | Assert.Equal(8, errors); |
@@ -55,7 +55,7 @@ namespace WixToolsetTest.Converters | |||
55 | File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); | 55 | File.Copy(Path.Combine(folder, beforeFileName), Path.Combine(baseFolder, beforeFileName)); |
56 | 56 | ||
57 | var messaging = new MockMessaging(); | 57 | var messaging = new MockMessaging(); |
58 | var converter = new Wix3Converter(messaging, 4); | 58 | var converter = new WixConverter(messaging, 4); |
59 | var errors = converter.ConvertFile(targetFile, true); | 59 | var errors = converter.ConvertFile(targetFile, true); |
60 | 60 | ||
61 | Assert.Equal(7, errors); | 61 | Assert.Equal(7, errors); |
@@ -164,7 +164,7 @@ namespace WixToolsetTest.Converters | |||
164 | private static void EnsureFixed(string targetFile) | 164 | private static void EnsureFixed(string targetFile) |
165 | { | 165 | { |
166 | var messaging2 = new MockMessaging(); | 166 | var messaging2 = new MockMessaging(); |
167 | var converter2 = new Wix3Converter(messaging2, 4); | 167 | var converter2 = new WixConverter(messaging2, 4); |
168 | var errors2 = converter2.ConvertFile(targetFile, true); | 168 | var errors2 = converter2.ConvertFile(targetFile, true); |
169 | Assert.Equal(0, errors2); | 169 | Assert.Equal(0, errors2); |
170 | } | 170 | } |
diff --git a/src/test/WixToolsetTest.Converters/CustomActionFixture.cs b/src/test/WixToolsetTest.Converters/CustomActionFixture.cs index 27d45bc6..e19de6e3 100644 --- a/src/test/WixToolsetTest.Converters/CustomActionFixture.cs +++ b/src/test/WixToolsetTest.Converters/CustomActionFixture.cs | |||
@@ -34,7 +34,7 @@ namespace WixToolsetTest.Converters | |||
34 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 34 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
35 | 35 | ||
36 | var messaging = new MockMessaging(); | 36 | var messaging = new MockMessaging(); |
37 | var converter = new Wix3Converter(messaging, 2, null, null); | 37 | var converter = new WixConverter(messaging, 2, null, null); |
38 | 38 | ||
39 | var errors = converter.ConvertDocument(document); | 39 | var errors = converter.ConvertDocument(document); |
40 | 40 | ||
@@ -72,7 +72,7 @@ namespace WixToolsetTest.Converters | |||
72 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 72 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
73 | 73 | ||
74 | var messaging = new MockMessaging(); | 74 | var messaging = new MockMessaging(); |
75 | var converter = new Wix3Converter(messaging, 2, null, null); | 75 | var converter = new WixConverter(messaging, 2, null, null); |
76 | 76 | ||
77 | var errors = converter.ConvertDocument(document); | 77 | var errors = converter.ConvertDocument(document); |
78 | 78 | ||
diff --git a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs index b61dbb10..10ee2748 100644 --- a/src/test/WixToolsetTest.Converters/CustomTableFixture.cs +++ b/src/test/WixToolsetTest.Converters/CustomTableFixture.cs | |||
@@ -37,7 +37,7 @@ namespace WixToolsetTest.Converters | |||
37 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 37 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
38 | 38 | ||
39 | var messaging = new MockMessaging(); | 39 | var messaging = new MockMessaging(); |
40 | var converter = new Wix3Converter(messaging, 2, null, null); | 40 | var converter = new WixConverter(messaging, 2, null, null); |
41 | 41 | ||
42 | var errors = converter.ConvertDocument(document); | 42 | var errors = converter.ConvertDocument(document); |
43 | Assert.Equal(4, errors); | 43 | Assert.Equal(4, errors); |
@@ -75,7 +75,7 @@ namespace WixToolsetTest.Converters | |||
75 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 75 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
76 | 76 | ||
77 | var messaging = new MockMessaging(); | 77 | var messaging = new MockMessaging(); |
78 | var converter = new Wix3Converter(messaging, 2, null, null); | 78 | var converter = new WixConverter(messaging, 2, null, null); |
79 | 79 | ||
80 | var errors = converter.ConvertDocument(document); | 80 | var errors = converter.ConvertDocument(document); |
81 | Assert.Equal(3, errors); | 81 | Assert.Equal(3, errors); |
@@ -114,7 +114,7 @@ namespace WixToolsetTest.Converters | |||
114 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 114 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
115 | 115 | ||
116 | var messaging = new MockMessaging(); | 116 | var messaging = new MockMessaging(); |
117 | var converter = new Wix3Converter(messaging, 2, null, null); | 117 | var converter = new WixConverter(messaging, 2, null, null); |
118 | 118 | ||
119 | var errors = converter.ConvertDocument(document); | 119 | var errors = converter.ConvertDocument(document); |
120 | Assert.Equal(2, errors); | 120 | Assert.Equal(2, errors); |
@@ -150,7 +150,7 @@ namespace WixToolsetTest.Converters | |||
150 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 150 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
151 | 151 | ||
152 | var messaging = new MockMessaging(); | 152 | var messaging = new MockMessaging(); |
153 | var converter = new Wix3Converter(messaging, 2, null, null); | 153 | var converter = new WixConverter(messaging, 2, null, null); |
154 | 154 | ||
155 | var errors = converter.ConvertDocument(document); | 155 | var errors = converter.ConvertDocument(document); |
156 | Assert.Equal(2, errors); | 156 | Assert.Equal(2, errors); |
@@ -175,7 +175,7 @@ namespace WixToolsetTest.Converters | |||
175 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 175 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
176 | 176 | ||
177 | var messaging = new MockMessaging(); | 177 | var messaging = new MockMessaging(); |
178 | var converter = new Wix3Converter(messaging, 2, null, null); | 178 | var converter = new WixConverter(messaging, 2, null, null); |
179 | 179 | ||
180 | var errors = converter.ConvertDocument(document); | 180 | var errors = converter.ConvertDocument(document); |
181 | 181 | ||
diff --git a/src/test/WixToolsetTest.Converters/PropertyFixture.cs b/src/test/WixToolsetTest.Converters/PropertyFixture.cs index 90c1e5c9..e50a6518 100644 --- a/src/test/WixToolsetTest.Converters/PropertyFixture.cs +++ b/src/test/WixToolsetTest.Converters/PropertyFixture.cs | |||
@@ -32,7 +32,7 @@ namespace WixToolsetTest.Converters | |||
32 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 32 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
33 | 33 | ||
34 | var messaging = new MockMessaging(); | 34 | var messaging = new MockMessaging(); |
35 | var converter = new Wix3Converter(messaging, 2, null, null); | 35 | var converter = new WixConverter(messaging, 2, null, null); |
36 | 36 | ||
37 | var errors = converter.ConvertDocument(document); | 37 | var errors = converter.ConvertDocument(document); |
38 | 38 | ||
@@ -66,7 +66,7 @@ namespace WixToolsetTest.Converters | |||
66 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 66 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
67 | 67 | ||
68 | var messaging = new MockMessaging(); | 68 | var messaging = new MockMessaging(); |
69 | var converter = new Wix3Converter(messaging, 2, null, null); | 69 | var converter = new WixConverter(messaging, 2, null, null); |
70 | 70 | ||
71 | var errors = converter.ConvertDocument(document); | 71 | var errors = converter.ConvertDocument(document); |
72 | 72 | ||
@@ -96,7 +96,7 @@ namespace WixToolsetTest.Converters | |||
96 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 96 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
97 | 97 | ||
98 | var messaging = new MockMessaging(); | 98 | var messaging = new MockMessaging(); |
99 | var converter = new Wix3Converter(messaging, 2, null, null); | 99 | var converter = new WixConverter(messaging, 2, null, null); |
100 | var errors = converter.ConvertDocument(document); | 100 | var errors = converter.ConvertDocument(document); |
101 | 101 | ||
102 | var actual = UnformattedDocumentString(document); | 102 | var actual = UnformattedDocumentString(document); |
diff --git a/src/test/WixToolsetTest.Converters/SequenceFixture.cs b/src/test/WixToolsetTest.Converters/SequenceFixture.cs index 1abe6c0c..2fbc4d4a 100644 --- a/src/test/WixToolsetTest.Converters/SequenceFixture.cs +++ b/src/test/WixToolsetTest.Converters/SequenceFixture.cs | |||
@@ -36,7 +36,7 @@ namespace WixToolsetTest.Converters | |||
36 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); | 36 | var document = XDocument.Parse(parse, LoadOptions.PreserveWhitespace | LoadOptions.SetLineInfo); |
37 | 37 | ||
38 | var messaging = new MockMessaging(); | 38 | var messaging = new MockMessaging(); |
39 | var converter = new Wix3Converter(messaging, 2, null, null); | 39 | var converter = new WixConverter(messaging, 2, null, null); |
40 | 40 | ||
41 | var errors = converter.ConvertDocument(document); | 41 | var errors = converter.ConvertDocument(document); |
42 | Assert.Equal(2, errors); | 42 | Assert.Equal(2, errors); |