Bug 78318 - Backport performance tests
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildPerformanceTest.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildPerformanceTest.java
index 953ef53..cec2e19 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildPerformanceTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildPerformanceTest.java
@@ -129,20 +129,25 @@
 	 * Waits for all of the lines to be appended to the console.
 	 * 
 	 * @param mainTypeName the program to launch
+	 * @param i the number of times to perform the launch
 	 * @return thread in which the first suspend event occurred
 	 */
-	protected void launch(String buildFileName) throws CoreException {
+	protected void launch(String buildFileName, int i) throws CoreException {
 		startMeasuring();
-		super.launch(buildFileName);
+		for (int j = 0; j < i; j++) {
+		    super.launch(buildFileName);    
+        }
 		stopMeasuring();
 	}
 	
 	/* (non-Javadoc)
 	 * @see org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest#launch(java.lang.String, java.lang.String)
 	 */
-	protected void launch(String buildFileName, String arguments) throws CoreException {
-		startMeasuring();
-		super.launch(buildFileName, arguments);
+	protected void launch(String buildFileName, String arguments, int i) throws CoreException {
+	    startMeasuring();
+		for (int j = 0; j < i; j++) {
+		    super.launch(buildFileName, arguments);
+		}
 		stopMeasuring();
 	}
 }
\ No newline at end of file
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/OpenLaunchConfigurationDialogTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
index 4619c1b..f8c96bd 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/OpenLaunchConfigurationDialogTests.java
@@ -33,8 +33,8 @@
         //cold run
         ILaunchConfiguration configuration= getLaunchConfiguration("big");
 		IStructuredSelection selection= new StructuredSelection(configuration);
-		for (int i = 0; i < 20; i++) {
-		    openLCD(selection, fgIdentifier); 
+		for (int i = 0; i < 10; i++) {
+		    openLCD(selection, fgIdentifier, 20); 
         }
 		
 		commitMeasurements();
@@ -46,8 +46,8 @@
         ILaunchConfiguration configuration= getLaunchConfiguration("big");
 		IStructuredSelection selection= new StructuredSelection(configuration);
 		tagAsSummary("Open LCD on Targets tab", Dimension.CPU_TIME);
-		for (int i = 0; i < 20; i++) {
-		    openLCD(selection, fgIdentifier); 
+		for (int i = 0; i < 10; i++) {
+		    openLCD(selection, fgIdentifier, 20); 
         }
 		
 		commitMeasurements();
@@ -61,18 +61,20 @@
 		return config;
     }
 
-    private void openLCD(final IStructuredSelection selection, final String groupIdentifier) {
-       
-        //set a status to go to the targets tab
-	    IStatus status = new Status(IStatus.INFO, IAntUIConstants.PLUGIN_ID, IAntUIConstants.STATUS_INIT_RUN_ANT, "", null); //$NON-NLS-1$
-		LaunchConfigurationsDialog dialog= new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier));
-		dialog.setBlockOnOpen(false);
-		dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
-		dialog.setInitialSelection(selection);
-		dialog.setInitialStatus(status);
-		startMeasuring();
-		dialog.open();
-		dialog.close();
+    private void openLCD(final IStructuredSelection selection, final String groupIdentifier, int numberOfOpens) {
+        startMeasuring();
+        for (int i = 0; i < numberOfOpens; i++) {
+	        //set a status to go to the targets tab
+		    IStatus status = new Status(IStatus.INFO, IAntUIConstants.PLUGIN_ID, IAntUIConstants.STATUS_INIT_RUN_ANT, "", null); //$NON-NLS-1$
+			LaunchConfigurationsDialog dialog= new LaunchConfigurationsDialog(DebugUIPlugin.getShell(), DebugUIPlugin.getDefault().getLaunchConfigurationManager().getLaunchGroup(groupIdentifier));
+			dialog.setBlockOnOpen(false);
+			dialog.setOpenMode(LaunchConfigurationsDialog.LAUNCH_CONFIGURATION_DIALOG_OPEN_ON_SELECTION);
+			dialog.setInitialSelection(selection);
+			dialog.setInitialStatus(status);
+			
+			dialog.open();
+			dialog.close();
+        }
 		stopMeasuring();
     }
 }
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/SeparateVMTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/SeparateVMTests.java
index 420e2cb..8ba7430 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/SeparateVMTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/performance/SeparateVMTests.java
@@ -33,7 +33,7 @@
 	public void testBuild() throws CoreException {
     	tagAsSummary("Simple separate JRE Build", Dimension.CPU_TIME);
     	for (int i = 0; i < 10; i++) {
-    		launch("echoingSepVM");
+    		launch("echoingSepVM", 10);
 		}
     	commitMeasurements();
 		assertPerformance(); 	
@@ -45,7 +45,7 @@
     public void testBuildMinusDebug() throws CoreException {
     	tagAsSummary("Simple separate JRE Build with debug information", Dimension.CPU_TIME);
     	for (int i = 0; i < 10; i++) {
-    		launch("echoingSepVM", "-debug");
+    		launch("echoingSepVM", "-debug", 10);
         }
     	commitMeasurements();
 		assertPerformance();