require 'test/unit' class IntegrationTest < Test::Unit::TestCase include MirrorTest def testSimpleBranch 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", "New file") file2 = File.join(root, "file2") @p4.run_integrate(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 testSimpleIntegrateWithoutResolve 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", "New file") file2 = File.join(root, "file2") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 into file2") @p4.run_edit("-t", "text+m", file1) File.open(file1, "a") do |f| f.puts("More content") end @p4.run_submit("-d", "New content") @p4.run_integrate(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 testSimpleIntegrateWithResolve 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", "New file") file2 = File.join(root, "file2") @p4.run_integrate(file1, file2) @p4.run_submit("-d", "Branched file1 into file2") @p4.run_edit("-t", "text+m", file1) File.open(file1, "a") do |f| f.puts("More content") end @p4.run_submit("-d", "New content") @p4.run_integrate(file1, file2) @p4.run_resolve() do |md| if md.action_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") end end