public void LockedLink_SyncUnlockedFirstThenUpdateLocked() { TestEnvironment.CustomActions += new MigrationTestEnvironment.Customize(ConfigCustomizer.CustomActions_DisableContextSync); // add a work item on source side string title1 = string.Format("Parent {0} {1}", TestContext.TestName, DateTime.Now.ToString("HH'_'mm'_'ss")); int workitemId1 = SourceAdapter.AddWorkItem("Bug", title1, "description1"); string title2 = string.Format("Child {0} {1}", TestContext.TestName, DateTime.Now.ToString("HH'_'mm'_'ss")); int workitemId2 = SourceAdapter.AddWorkItem("Bug", title2, "description2"); RunAndNoValidate(); TfsSourceAdapter.AddParentChildLink(workitemId1, workitemId2, false); RunAndNoValidate(true); // verify there's no conflicts raised ConflictResolver conflictResolver = new ConflictResolver(Configuration); List <RTConflict> conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); TfsSourceAdapter.UpdateLinkLockOption(workitemId1, workitemId2, true); RunAndNoValidate(true); // verify there's no conflict raised conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); RunAndNoValidate(true); // verify sync result WitDiffResult result = GetDiffResult(); // ignore Area/Iteration path mismatches VerifySyncResult(result, new List <string> { FIELD_ITERATION_PATH, FIELD_AREA_PATH }); int mirroredId1 = QueryMirroredWorkItemID(workitemId1); int mirroredId2 = QueryMirroredWorkItemID(workitemId2); Assert.IsTrue(TfsTargetAdapter.IsLinkLocked(mirroredId1, mirroredId2), "migrated link is not locked"); }
public void LockedLink_RemoveLockAndDeleteLinkSyncTest() { TestEnvironment.CustomActions += new MigrationTestEnvironment.Customize(ConfigCustomizer.CustomActions_DisableContextSync); // add a work item on source side string title1 = string.Format("Parent {0} {1}", TestContext.TestName, DateTime.Now.ToString("HH'_'mm'_'ss")); int workitemId1 = SourceAdapter.AddWorkItem("Bug", title1, "description1"); string title2 = string.Format("Child {0} {1}", TestContext.TestName, DateTime.Now.ToString("HH'_'mm'_'ss")); int workitemId2 = SourceAdapter.AddWorkItem("Bug", title2, "description2"); RunAndNoValidate(); TfsSourceAdapter.AddParentChildLink(workitemId1, workitemId2, true); RunAndNoValidate(true); // verify there's no conflicts raised ConflictResolver conflictResolver = new ConflictResolver(Configuration); List <RTConflict> conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); TfsSourceAdapter.UpdateLinkLockOption(workitemId1, workitemId2, false); TfsSourceAdapter.DeleteParentChildLink(workitemId1, workitemId2); RunAndNoValidate(true); // verify there's a conflict raised conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(1, conflicts.Count, "There should be 1 conflict"); conflictResolver.TryResolveConflict(conflicts[0], ConflictConstant.TFSModifyLockedWorkItemLinkConflict_ResolveByForceDeleteAction, conflicts[0].ScopeHint); RunAndNoValidate(true); // verify sync result WitDiffResult result = GetDiffResult(); // ignore Area/Iteration path mismatches VerifySyncResult(result, new List <string> { FIELD_ITERATION_PATH, FIELD_AREA_PATH }); }
public void LockedLink_SyncUnlockedFirstThenUpdateLocked() { // add a work item on source side int workitemId1 = SourceAdapter.AddWorkItem("Bug", "parent", "description1"); int workitemId2 = SourceAdapter.AddWorkItem("Bug", "child", "description2"); RunAndNoValidate(); TfsSourceAdapter.AddParentChildLink(workitemId1, workitemId2, false); RunAndNoValidate(true); // verify there's no conflicts raised ConflictResolver conflictResolver = new ConflictResolver(Configuration); List <RTConflict> conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); TfsSourceAdapter.UpdateLinkLockOption(workitemId1, workitemId2, true); RunAndNoValidate(true); // verify there's no conflict raised conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); RunAndNoValidate(true); // verify sync result WitDiffResult result = GetDiffResult(); // ignore Area/Iteration path mismatches VerifySyncResult(result, new List <string> { FIELD_ITERATION_PATH, FIELD_AREA_PATH }); int mirroredId1 = QueryTargetWorkItemID(workitemId1); int mirroredId2 = QueryTargetWorkItemID(workitemId2); Assert.IsTrue(TfsTargetAdapter.IsLinkLocked(mirroredId1, mirroredId2), "migrated link is not locked"); }
public void LockedLink_SkipDeleteLinkSyncTest() { // add a work item on source side int workitemId1 = SourceAdapter.AddWorkItem("Bug", "parent", "description1"); int workitemId2 = SourceAdapter.AddWorkItem("Bug", "child", "description2"); RunAndNoValidate(); TfsSourceAdapter.AddParentChildLink(workitemId1, workitemId2, true); RunAndNoValidate(true); // verify there's no conflicts raised ConflictResolver conflictResolver = new ConflictResolver(Configuration); List <RTConflict> conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); TfsSourceAdapter.UpdateLinkLockOption(workitemId1, workitemId2, false); TfsSourceAdapter.DeleteParentChildLink(workitemId1, workitemId2); RunAndNoValidate(true); // verify there's a conflict raised conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(1, conflicts.Count, "There should be 1 conflict"); conflictResolver.TryResolveConflict(conflicts[0], new SkipConflictedActionResolutionAction().ReferenceName, conflicts[0].ScopeHint); RunAndNoValidate(true); // verify sync result WitDiffResult result = GetDiffResult(); //// ignore Area/Iteration path mismatches //VerifySyncResult(result, new List<string> { FIELD_ITERATION_PATH, FIELD_AREA_PATH }); // TODO: Why does TwoWayRight have only one link mismatch, but the others have 2? Assert.AreEqual(2, result.LinkMismatchCount); }
public void LockedLink_RemoveLockAndDeleteLinkSyncTest() { // add a work item on source side int workitemId1 = SourceAdapter.AddWorkItem("Bug", "parent", "description1"); int workitemId2 = SourceAdapter.AddWorkItem("Bug", "child", "description2"); RunAndNoValidate(); TfsSourceAdapter.AddParentChildLink(workitemId1, workitemId2, true); RunAndNoValidate(true); // verify there's no conflicts raised ConflictResolver conflictResolver = new ConflictResolver(Configuration); List <RTConflict> conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(0, conflicts.Count, "There should be no conflicts"); TfsSourceAdapter.UpdateLinkLockOption(workitemId1, workitemId2, false); TfsSourceAdapter.DeleteParentChildLink(workitemId1, workitemId2); RunAndNoValidate(true); // verify there's a conflict raised conflicts = conflictResolver.GetConflicts(); Assert.AreEqual(1, conflicts.Count, "There should be 1 conflict"); conflictResolver.TryResolveConflict(conflicts[0], ConflictConstant.TFSModifyLockedWorkItemLinkConflict_ResolveByForceDeleteAction, conflicts[0].ScopeHint); RunAndNoValidate(true); // verify sync result WitDiffResult result = GetDiffResult(); // ignore Area/Iteration path mismatches VerifySyncResult(result, new List <string> { FIELD_ITERATION_PATH, FIELD_AREA_PATH }); }