diff options
Diffstat (limited to 'src/test/burn/TestBA')
-rw-r--r-- | src/test/burn/TestBA/TestBA.cs | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/src/test/burn/TestBA/TestBA.cs b/src/test/burn/TestBA/TestBA.cs index 1556acd0..51fc1cbd 100644 --- a/src/test/burn/TestBA/TestBA.cs +++ b/src/test/burn/TestBA/TestBA.cs | |||
@@ -41,6 +41,8 @@ namespace WixToolset.Test.BA | |||
41 | private int cancelOnProgressAtProgress; | 41 | private int cancelOnProgressAtProgress; |
42 | private int retryExecuteFilesInUse; | 42 | private int retryExecuteFilesInUse; |
43 | private bool rollingBack; | 43 | private bool rollingBack; |
44 | private string forceDownloadSource; | ||
45 | private string forceUpdateSource; | ||
44 | 46 | ||
45 | private IBootstrapperCommand Command { get; set; } | 47 | private IBootstrapperCommand Command { get; set; } |
46 | 48 | ||
@@ -216,9 +218,28 @@ namespace WixToolset.Test.BA | |||
216 | } | 218 | } |
217 | } | 219 | } |
218 | 220 | ||
221 | protected override void OnDetectBegin(DetectBeginEventArgs args) | ||
222 | { | ||
223 | this.Log("OnDetectBegin"); | ||
224 | |||
225 | this.forceUpdateSource = this.ReadPackageAction(null, "ForceUpdateSource"); | ||
226 | if (!String.IsNullOrEmpty(this.forceUpdateSource)) | ||
227 | { | ||
228 | this.Log(" OnDetectBegin::ForceUpdateSource: {0}", this.forceUpdateSource); | ||
229 | } | ||
230 | |||
231 | } | ||
232 | |||
219 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) | 233 | protected override void OnDetectUpdateBegin(DetectUpdateBeginEventArgs args) |
220 | { | 234 | { |
221 | this.Log("OnDetectUpdateBegin"); | 235 | this.Log("OnDetectUpdateBegin"); |
236 | |||
237 | if (!String.IsNullOrEmpty(this.forceUpdateSource)) | ||
238 | { | ||
239 | this.Log(" OnDetectUpdateBegin::ForceUpdateSource: {0}", this.forceUpdateSource); | ||
240 | this.Engine.SetUpdateSource(this.forceUpdateSource, String.Empty); | ||
241 | } | ||
242 | |||
222 | if (LaunchAction.UpdateReplaceEmbedded == this.action || LaunchAction.UpdateReplace == this.action) | 243 | if (LaunchAction.UpdateReplaceEmbedded == this.action || LaunchAction.UpdateReplace == this.action) |
223 | { | 244 | { |
224 | args.Skip = false; | 245 | args.Skip = false; |
@@ -375,6 +396,12 @@ namespace WixToolset.Test.BA | |||
375 | { | 396 | { |
376 | this.Log(" CancelCacheAtProgress: {0}", this.cancelCacheAtProgress); | 397 | this.Log(" CancelCacheAtProgress: {0}", this.cancelCacheAtProgress); |
377 | } | 398 | } |
399 | |||
400 | this.forceDownloadSource = this.ReadPackageAction(args.PackageId, "ForceDownloadSource"); | ||
401 | if (!String.IsNullOrEmpty(this.forceDownloadSource)) | ||
402 | { | ||
403 | this.Log(" ForceDownloadSource: {0}", this.forceDownloadSource); | ||
404 | } | ||
378 | } | 405 | } |
379 | 406 | ||
380 | protected override void OnCachePackageNonVitalValidationFailure(CachePackageNonVitalValidationFailureEventArgs args) | 407 | protected override void OnCachePackageNonVitalValidationFailure(CachePackageNonVitalValidationFailureEventArgs args) |
@@ -387,6 +414,29 @@ namespace WixToolset.Test.BA | |||
387 | this.Log("OnCachePackageNonVitalValidationFailure() - id: {0}, default: {1}, requested: {2}", args.PackageId, args.Recommendation, args.Action); | 414 | this.Log("OnCachePackageNonVitalValidationFailure() - id: {0}, default: {1}, requested: {2}", args.PackageId, args.Recommendation, args.Action); |
388 | } | 415 | } |
389 | 416 | ||
417 | protected override void OnCacheAcquireResolving(CacheAcquireResolvingEventArgs args) | ||
418 | { | ||
419 | if (!String.IsNullOrEmpty(this.forceDownloadSource)) | ||
420 | { | ||
421 | args.Action = CacheResolveOperation.Download; | ||
422 | var url = String.Format(this.forceDownloadSource, args.PayloadId); | ||
423 | |||
424 | this.Log("OnCacheAcquireResolving: {0} => {1}", this.forceDownloadSource, url); | ||
425 | |||
426 | this.engine.SetDownloadSource( | ||
427 | String.Empty, | ||
428 | args.PayloadId, | ||
429 | url, | ||
430 | String.Empty, | ||
431 | String.Empty, | ||
432 | String.Empty); | ||
433 | } | ||
434 | else | ||
435 | { | ||
436 | this.Log("OnCacheAcquireResolving not forcing download"); | ||
437 | } | ||
438 | } | ||
439 | |||
390 | protected override void OnCacheAcquireProgress(CacheAcquireProgressEventArgs args) | 440 | protected override void OnCacheAcquireProgress(CacheAcquireProgressEventArgs args) |
391 | { | 441 | { |
392 | this.Log("OnCacheAcquireProgress() - container/package: {0}, payload: {1}, progress: {2}, total: {3}, overall progress: {4}%", args.PackageOrContainerId, args.PayloadId, args.Progress, args.Total, args.OverallPercentage); | 442 | this.Log("OnCacheAcquireProgress() - container/package: {0}, payload: {1}, progress: {2}, total: {3}, overall progress: {4}%", args.PackageOrContainerId, args.PayloadId, args.Progress, args.Total, args.OverallPercentage); |