Bug 574331: Set default query results for tests

Most of the tests in this bundle already had this bit of code
before calling create project. This makes BuildDescriptionModelTests
consistent with the rest.

Note that this modifies global state and does not restore it. However,
as that is consistent with the other tests in this bundle, and the
global state is only maintained while running tests on this bundle,
I am not fixing this aspect of the code.

Change-Id: I2004af177a959e1efbd45b23c960b517d8993b7c
diff --git a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java
index 5cd67e3..ee09c00 100644
--- a/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java
+++ b/build/org.eclipse.cdt.managedbuilder.core.tests/tests/org/eclipse/cdt/managedbuilder/core/tests/BuildDescriptionModelTests.java
@@ -55,6 +55,7 @@
 import org.eclipse.cdt.managedbuilder.internal.core.Configuration;
 import org.eclipse.cdt.managedbuilder.macros.BuildMacroException;
 import org.eclipse.cdt.managedbuilder.macros.IBuildMacroProvider;
+import org.eclipse.cdt.managedbuilder.projectconverter.UpdateManagedProjectManager;
 import org.eclipse.cdt.managedbuilder.testplugin.ManagedBuildTestHelper;
 import org.eclipse.core.resources.IFile;
 import org.eclipse.core.resources.IProject;
@@ -62,6 +63,7 @@
 import org.eclipse.core.runtime.IPath;
 import org.eclipse.core.runtime.NullProgressMonitor;
 import org.eclipse.core.runtime.Path;
+import org.eclipse.ui.dialogs.IOverwriteQuery;
 
 import junit.framework.Test;
 import junit.framework.TestCase;
@@ -877,6 +879,17 @@
 	}
 
 	private IProject createProject(String name, String id) {
+
+		//  In case the projects need to be updated...
+		IOverwriteQuery queryALL = new IOverwriteQuery() {
+			@Override
+			public String queryOverwrite(String file) {
+				return ALL;
+			}
+		};
+		UpdateManagedProjectManager.setBackupFileOverwriteQuery(queryALL);
+		UpdateManagedProjectManager.setUpdateProjectQuery(queryALL);
+
 		IProject proj = ManagedBuildTestHelper.createProject(name, id);
 		if (proj != null)
 			fCompositeCleaner.addRunnable(new ProjectCleaner(proj));