Backported performance tests to 3.0 and 3.0.1
diff --git a/tests/org.eclipse.team.tests.cvs.core/build.properties b/tests/org.eclipse.team.tests.cvs.core/build.properties
index df89da5..88d081d 100644
--- a/tests/org.eclipse.team.tests.cvs.core/build.properties
+++ b/tests/org.eclipse.team.tests.cvs.core/build.properties
@@ -9,4 +9,10 @@
 #     IBM Corporation - initial API and implementation
 ###############################################################################
 source.cvstests.jar=src/
-bin.includes=about.html,plugin.xml,*.jar,test.xml,repository.properties
\ No newline at end of file
+bin.includes = about.html,\
+               plugin.xml,\
+               *.jar,\
+               test.xml,\
+               repository.properties,\
+               resources/
+src.includes = resources/
diff --git a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/Performance - SyncTests.launch b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/Performance - SyncTests.launch
index fe11436..ce12189 100644
--- a/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/Performance - SyncTests.launch
+++ b/tests/org.eclipse.team.tests.cvs.core/launchConfigurations/Performance - SyncTests.launch
@@ -1,16 +1,16 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<stringAttribute key="product" value="org.eclipse.jabber.standalone1.product"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
 <booleanAttribute key="clearws" value="true"/>
 <stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.ui.benchmark.SyncTests"/>
 <booleanAttribute key="useProduct" value="false"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.team.tests.ccvs.ui.benchmark.WorkflowTests"/>
 <booleanAttribute key="tracing" value="false"/>
 <stringAttribute key="location1" value="C:\Eclipse\Latest\eclipse-0924\runtime-test-workspace"/>
-<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -DInternalPrintPerformanceResults"/>
 <booleanAttribute key="default" value="true"/>
-<booleanAttribute key="clearConfig" value="false"/>
+<stringAttribute key="vmargs" value="-Declipse.cvs.properties=c:\eclipse\repository.properties -DInternalPrintPerformanceResults"/>
 <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="clearConfig" value="false"/>
 <booleanAttribute key="org.eclipse.debug.core.appendEnvironmentVariables" value="true"/>
 <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
 <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
diff --git a/tests/org.eclipse.team.tests.cvs.core/plugin.xml b/tests/org.eclipse.team.tests.cvs.core/plugin.xml
index cbdd28e..fbe7043 100644
--- a/tests/org.eclipse.team.tests.cvs.core/plugin.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/plugin.xml
@@ -30,6 +30,7 @@
       <import plugin="org.eclipse.update.core"/>
       <import plugin="org.junit"/>
       <import plugin="org.eclipse.team.tests.core"/>
+      <import plugin="org.eclipse.test.performance"/>
    </requires>
 
 
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
index b9fa366..12d4b22 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/EclipseTest.java
@@ -202,21 +202,28 @@
 			CVSWorkspaceRoot.getCVSResourceFor(resources[i]).unmanage(null);
 		}
 	}
+	
 	/**
 	 * Update the resources from an existing container with the changes from the CVS repository
 	 */
 	public IResource[] updateResources(IContainer container, String[] hierarchy, boolean ignoreLocalChanges) throws CoreException, TeamException {
 		IResource[] resources = getResources(container, hierarchy);
-		LocalOption[] options = Command.NO_LOCAL_OPTIONS;
+		return updateResources(resources, ignoreLocalChanges);
+	}
+	
+	/**
+	 * Update the resources from an existing container with the changes from the CVS repository
+	 */
+    protected IResource[] updateResources(IResource[] resources, boolean ignoreLocalChanges) throws CVSException {
+        LocalOption[] options = Command.NO_LOCAL_OPTIONS;
 		if(ignoreLocalChanges) {
 			options = new LocalOption[] {Update.IGNORE_LOCAL_CHANGES};
 		}
 		executeHeadless(new UpdateOperation(null, resources, options, null));
 		return resources;
-	}
-	
-	
-	protected void replace(IContainer container, String[] hierarchy, CVSTag tag, boolean recurse) throws CoreException {
+    }
+
+    protected void replace(IContainer container, String[] hierarchy, CVSTag tag, boolean recurse) throws CoreException {
 		IResource[] resources = getResources(container, hierarchy);
 		replace(resources, tag, recurse);
 	}
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SyncInfoSource.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SyncInfoSource.java
index 7eb7b9a..0fa5b2a 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SyncInfoSource.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/core/subscriber/SyncInfoSource.java
@@ -61,9 +61,16 @@
 	 * Refresh the subscriber for the given resource
 	 */
 	public void refresh(Subscriber subscriber, IResource resource) throws TeamException {
-		subscriber.refresh(new IResource[] { resource}, IResource.DEPTH_INFINITE, DEFAULT_MONITOR);
+		refresh(subscriber, new IResource[] { resource});
 	}
 	
+	/**
+	 * Refresh the subscriber for the given resources
+	 */
+    public void refresh(Subscriber subscriber, IResource[] resources) throws TeamException {
+        subscriber.refresh(resources, IResource.DEPTH_INFINITE, DEFAULT_MONITOR);
+    }
+    
 	protected void assertProjectRemoved(Subscriber subscriber, IProject project) throws TeamException {
 		IResource[] roots = subscriber.roots();
 		for (int i = 0; i < roots.length; i++) {
diff --git a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
index e6469c1..78de591 100644
--- a/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
+++ b/tests/org.eclipse.team.tests.cvs.core/src/org/eclipse/team/tests/ccvs/ui/SynchronizeViewTestAdapter.java
@@ -208,13 +208,14 @@
 	}
 	
 	/* (non-Javadoc)
-	 * @see org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource#refresh(org.eclipse.team.core.subscribers.TeamSubscriber, org.eclipse.core.resources.IResource)
-	 */
-	public void refresh(Subscriber subscriber, IResource resource) throws TeamException {
-		super.refresh(subscriber, resource);
+     * @see org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource#refresh(org.eclipse.team.core.subscribers.Subscriber, org.eclipse.core.resources.IResource[])
+     */
+    public void refresh(Subscriber subscriber, IResource[] resources)
+            throws TeamException {
+        super.refresh(subscriber, resources);
 		// Getting the collector waits for the subscriber input handlers
 		getCollector(subscriber);
-	}
+    }
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.team.tests.ccvs.core.subscriber.SyncInfoSource#reset()
diff --git a/tests/org.eclipse.team.tests.cvs.core/test.xml b/tests/org.eclipse.team.tests.cvs.core/test.xml
index f1ccd45..fe399ce 100644
--- a/tests/org.eclipse.team.tests.cvs.core/test.xml
+++ b/tests/org.eclipse.team.tests.cvs.core/test.xml
@@ -12,6 +12,9 @@
   <property name="org.eclipse.team.tests.cvs.core" value="org.eclipse.team.tests.cvs.core"/>
   <property name="team-home" value="${eclipse-home}/plugins/${org.eclipse.team.tests.cvs.core}"/>
   <property file="${team-home}/repository.properties"/>
+  
+  <!-- define the number of times each perfomance test shouldbe run to get an average performance -->
+  <property name="performance-loop-count" value="5"/>
 
   <!-- This target holds all initialization code that needs to be done for -->
   <!-- all tests that are to be run. Initialization for individual tests -->
@@ -20,7 +23,7 @@
     <tstamp/>
   </target>
 
-  <!-- This target defines the tests that need to be run. -->
+  <!-- This target defines the tests that need to be run for regression testing. -->
   <target name="suite">
     <property name="location" value="${eclipse-home}/cvs_sniff_folder"/>
     <delete dir="${location}" quiet="true"/>
@@ -40,10 +43,23 @@
       <property name="plugin-name" value="org.eclipse.team.tests.cvs.core"/>
       <property name="classname" value="org.eclipse.team.tests.ccvs.core.AllTests"/>
     </ant>
-    
 
   </target>
   
+  <!-- This target defines the performance tests that need to be run. -->
+  <target name="performance-suite">
+    <property name="cvs-performance-folder" 
+              value="${eclipse-home}/cvs_performance_folder"/>
+    <delete dir="${cvs-performance-folder}" quiet="true"/>
+    <ant target="ui-test" antfile="${library-file}" dir="${eclipse-home}">
+      <property name="vmargs" value="-Declipse.cvs.properties=${team-home}/repository.properties -Declipse.cvs.loopCount=5"/>
+      <property name="data-dir" value="${cvs-performance-folder}"/>
+      <property name="plugin-name" value="org.eclipse.team.tests.cvs.core"/>
+      <property name="classname" 
+                value="org.eclipse.team.tests.ccvs.ui.benchmark.WorkflowTests"/>
+    </ant>
+  </target>
+  
   <!-- This target holds code to cleanup the testing environment after the tests -->
   <!-- have been run. You can use this to delete temporary files that are created. -->
   <target name="cleanup">
@@ -58,4 +74,13 @@
     </ant>
   </target>
 
+  <!-- This target runs the performance test suite. Any actions that need to happen -->
+  <!-- after all the tests have been run should go here. -->
+  <target name="performance" depends="init,performance-suite,cleanup">
+    <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
+      <property name="includes" value="org*.xml"/>
+      <property name="output-file" value="org.eclipse.team.tests.cvs.xml"/>
+    </ant>
+  </target>
+
 </project>