printBranches(allBranches);
System.out.println("----------");
DatabaseReconciliator databaseReconciliator = new DatabaseReconciliator();
TestResult actualTestResult = new TestResult();
// Get 'local' branch
DatabaseBranch localBranch = allBranches.getBranch(localMachineName);
// Get all the other ones (clone 'all', and remove local)
DatabaseBranches unstitchedRemoteBranches = allBranches.clone();
unstitchedRemoteBranches.remove(localMachineName);
DatabaseBranches stitchedRemoteBranches = databaseReconciliator.stitchBranches(unstitchedRemoteBranches, localMachineName, localBranch);
System.out.println("Before Orchestration : Remote");
printBranches(unstitchedRemoteBranches);
System.out.println("Before Orchestration : Local");
printBranch(localBranch);
System.out.println("BEGIN Branch Orchestration!! ----------");
printBranches(stitchedRemoteBranches);
System.out.println("END Branch Orchestration ----------");
actualTestResult.lastCommonHeader = databaseReconciliator.findLastCommonDatabaseVersionHeader(localBranch, stitchedRemoteBranches);
actualTestResult.firstConflictingDatabaseVersionHeaders = databaseReconciliator.findFirstConflictingDatabaseVersionHeader(actualTestResult.lastCommonHeader, stitchedRemoteBranches);
actualTestResult.winningFirstConflictingDatabaseVersionHeaders = databaseReconciliator.findWinningFirstConflictingDatabaseVersionHeaders(actualTestResult.firstConflictingDatabaseVersionHeaders);
actualTestResult.winnersWinnersLastDatabaseVersionHeader = databaseReconciliator.findWinnersLastDatabaseVersionHeader(actualTestResult.winningFirstConflictingDatabaseVersionHeaders, stitchedRemoteBranches);
System.out.println("Actual lastCommonDatabaseVersionHeader = " +actualTestResult.lastCommonHeader);
System.out.println("Expect lastCommonDatabaseVersionHeader = " +expectedTestResult.lastCommonHeader);
System.out.println("Actual firstConflictingDatabaseVersionHeaders = "); printMap(actualTestResult.firstConflictingDatabaseVersionHeaders);