require 'test/unit' class NetAppTest < Test::Unit::TestCase include MirrorTest def testMergeBranchAndAccept root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_merge(file1, file2) @p4.run_resolve('-at') mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeBranchAndIgnore root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_merge(file1, file2) @p4.run_resolve('-ay') mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeBranchAndLeave root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_merge(file1, file2) mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeDeleteAndAccept root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_delete(file1) @p4.run_submit("-d", "deleted file1") @p4.run_merge(file1, file2) @p4.run_resolve("-at") mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeDeleteAndIgnore root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_delete(file1) @p4.run_submit("-d", "deleted file1") @p4.run_merge(file1, file2) @p4.run_resolve("-ay") mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeDeleteAndLeave root = use_source file1 = File.join(root, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") file2 = File.join(root, "file2") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_delete(file1) @p4.run_submit("-d", "deleted file1") @p4.run_merge(file1, file2) mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") end def testMergeMoveAndAccept root = use_source dir1 = File.join(root, "d1") Dir.mkdir( dir1 ) file1 = File.join(dir1, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") dir2 = File.join(root, "d2") Dir.mkdir( dir2 ) file2 = File.join(dir2, "file1") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_edit("-ttext+m", file1) file1_moved = File.join(root, "d1", "file1_moved") @p4.run_move(file1, file1_moved) @p4.run_submit("-d", "moved file1 and changed type") dir1 = File.join(dir1, "...") dir2 = File.join(dir2, "...") @p4.run_integrate(dir1, dir2) @p4.run_resolve("-at") mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 2, "Not two files open under target root") branches = @p4.run_branches() assert(branches.length == 0, "Failed to delete branch spec") end def testMergeMoveAndIgnore root = use_source dir1 = File.join(root, "d1") Dir.mkdir( dir1 ) file1 = File.join(dir1, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") dir2 = File.join(root, "d2") Dir.mkdir( dir2 ) file2 = File.join(dir2, "file1") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_edit("-ttext+m", file1) file1_moved = File.join(root, "d1", "file1_moved") @p4.run_move(file1, file1_moved) @p4.run_submit("-d", "moved file1 and changed type") dir1 = File.join(dir1, "...") dir2 = File.join(dir2, "...") @p4.run_integrate(dir1, dir2) @p4.run_resolve() do |md| if md.action_type == "Filename resolve" "ay" else "at" end end mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") branches = @p4.run_branches() assert(branches.length == 0, "Failed to delete branch spec") end def testMergeMoveAndLeave root = use_source dir1 = File.join(root, "d1") Dir.mkdir( dir1 ) file1 = File.join(dir1, "file1") File.open(file1, "w") do |f| f.puts("Some content") end @p4.run_add(file1) @p4.run_submit("-d", "Added file1") dir2 = File.join(root, "d2") Dir.mkdir( dir2 ) file2 = File.join(dir2, "file1") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 to file2") @p4.run_edit("-ttext+m", file1) file1_moved = File.join(root, "d1", "file1_moved") @p4.run_move(file1, file1_moved) @p4.run_submit("-d", "moved file1 and changed type") dir1 = File.join(dir1, "...") dir2 = File.join(dir2, "...") @p4.run_integrate(dir1, dir2) mirror_and_compare() root = use_target opened = @p4.run_opened("#{root}/...") assert(opened.length == 1, "Not one file open under target root") branches = @p4.run_branches() assert(branches.length == 0, "Failed to delete branch spec") end end
# | Change | User | Description | Committed | |
---|---|---|---|---|---|
#1 | 8264 | Sven Erik Knop |
MirrorPending. All test cases work including integrating moves in various resolve stages. |