Bug 560580 - Port ua performance test suites to JUnit 4.x

Change-Id: I36cf6a3cf41bdd22f7549880667b6562d1906348
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllPerformanceTests.java b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllPerformanceTests.java
index b889a11..2dbd7af 100644
--- a/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllPerformanceTests.java
+++ b/org.eclipse.ua.tests/base/org/eclipse/ua/tests/AllPerformanceTests.java
@@ -13,37 +13,23 @@
  *******************************************************************************/
 package org.eclipse.ua.tests;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.ua.tests.cheatsheet.AllCheatSheetPerformanceTests;
 import org.eclipse.ua.tests.help.AllHelpPerformanceTests;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /*
  * Tests all user assistance performance (automated).
  */
-public class AllPerformanceTests extends TestSuite {
+@RunWith(Suite.class)
+@SuiteClasses({ AllCheatSheetPerformanceTests.class, AllHelpPerformanceTests.class })
+public class AllPerformanceTests {
 
 	/*
-	 * Returns the entire performance test suite.
+	 * Disabled due to inability to backport test to 3.2. Internal test hooks
+	 * were added in 3.2.2 code base but do not exist in 3.2 so the test will
+	 * not be accurate.
 	 */
-	public static Test suite() {
-		return new AllPerformanceTests();
-	}
-
-	/*
-	 * Constructs a new test suite.
-	 */
-	public AllPerformanceTests() {
-		addTest(AllCheatSheetPerformanceTests.suite());
-		addTest(AllHelpPerformanceTests.suite());
-
-		/*
-		 * Disabled due to inability to backport test to 3.2. Internal
-		 * test hooks were added in 3.2.2 code base but do not exist in 3.2
-		 * so the test will not be accurate.
-		 */
-		//addTest(AllIntroPerformanceTests.suite());
-
-	}
+	// addTest(AllIntroPerformanceTests.suite());
 }
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetPerformanceTests.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetPerformanceTests.java
index 4d501cb..b510493 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetPerformanceTests.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/AllCheatSheetPerformanceTests.java
@@ -14,26 +14,15 @@
 package org.eclipse.ua.tests.cheatsheet;
 
 import org.eclipse.ua.tests.cheatsheet.performance.OpenCheatSheetTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /*
  * Tests help performance (automated).
  */
-public class AllCheatSheetPerformanceTests extends TestSuite {
+@RunWith(Suite.class)
+@SuiteClasses({ OpenCheatSheetTest.class })
+public class AllCheatSheetPerformanceTests {
 
-	/*
-	 * Returns the entire test suite.
-	 */
-	public static Test suite() {
-		return new AllCheatSheetPerformanceTests();
-	}
-
-	/*
-	 * Constructs a new performance test suite.
-	 */
-	public AllCheatSheetPerformanceTests() {
-		addTest(OpenCheatSheetTest.suite());
-	}
 }
diff --git a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
index 0e2dbca..d5cb572 100644
--- a/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
+++ b/org.eclipse.ua.tests/cheatsheet/org/eclipse/ua/tests/cheatsheet/performance/OpenCheatSheetTest.java
@@ -13,9 +13,6 @@
  *******************************************************************************/
 package org.eclipse.ua.tests.cheatsheet.performance;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.swt.widgets.Display;
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.PerformanceTestCase;
@@ -28,13 +25,6 @@
 
 public class OpenCheatSheetTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(OpenCheatSheetTest.class);
-	}
-
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpPerformanceTests.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpPerformanceTests.java
index 5a22564..c754bd9 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpPerformanceTests.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/AllHelpPerformanceTests.java
@@ -14,38 +14,25 @@
 package org.eclipse.ua.tests.help;
 
 import org.eclipse.ua.tests.help.performance.BuildHtmlSearchIndex;
-import org.eclipse.ua.tests.help.performance.IndexAssemblePerformanceTest;
 import org.eclipse.ua.tests.help.performance.HelpServerTest;
+import org.eclipse.ua.tests.help.performance.IndexAssemblePerformanceTest;
 import org.eclipse.ua.tests.help.performance.TocAssemblePerformanceTest;
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /*
  * Tests help performance (automated).
  */
-public class AllHelpPerformanceTests extends TestSuite {
+@RunWith(Suite.class)
+@SuiteClasses({ TocAssemblePerformanceTest.class, IndexAssemblePerformanceTest.class, BuildHtmlSearchIndex.class,
+		HelpServerTest.class })
+public class AllHelpPerformanceTests {
 
 	/*
-	 * Returns the entire test suite.
+	 * Disabled due to inability to get reliable results. Browser/SWT changes in
+	 * timing of listener events no longer consistent in 3.3.
 	 */
-	public static Test suite() {
-		return new AllHelpPerformanceTests();
-	}
 
-	/*
-	 * Constructs a new performance test suite.
-	 */
-	public AllHelpPerformanceTests() {
-
-		/*
-		 * Disabled due to inability to get reliable results. Browser/SWT
-		 * changes in timing of listener events no longer consistent in 3.3.
-		 */
-
-		//addTest(OpenHelpTest.suite());
-		addTest(TocAssemblePerformanceTest.suite());
-		addTest(IndexAssemblePerformanceTest.suite());
-		addTest(BuildHtmlSearchIndex.suite());
-		addTest(HelpServerTest.suite());
-	}
+	// addTest(OpenHelpTest.suite());
 }
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
index 0bffc50..7e832de 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/BuildHtmlSearchIndex.java
@@ -15,9 +15,6 @@
 
 import java.net.URL;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.core.runtime.IStatus;
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.help.AbstractIndexProvider;
@@ -40,13 +37,6 @@
 	private AbstractIndexProvider[] indexProviders;
 	private AnalyzerDescriptor analyzerDesc;
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(BuildHtmlSearchIndex.class);
-	}
-
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
index 0311c23..1d9f52c 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/HelpServerTest.java
@@ -14,9 +14,6 @@
 
 package org.eclipse.ua.tests.help.performance;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.PerformanceTestCase;
 import org.eclipse.ua.tests.help.util.LoadServletUtil;
@@ -27,13 +24,6 @@
 
 public class HelpServerTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(HelpServerTest.class);
-	}
-
 	@Override
 	protected void tearDown() throws Exception {
 		LoadServletUtil.stopServer();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
index f0bb1b3..7364425 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/IndexAssemblePerformanceTest.java
@@ -31,18 +31,8 @@
 import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
 import org.xml.sax.SAXException;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 public class IndexAssemblePerformanceTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(IndexAssemblePerformanceTest.class);
-	}
-
 	public void testIndexAssemble() throws Exception {
 		tagAsSummary("Assemble Index", Dimension.ELAPSED_PROCESS);
 
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
index 4a6bf9c..c6e1bbc 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/LowIterationHelpServerTest.java
@@ -14,9 +14,6 @@
 
 package org.eclipse.ua.tests.help.performance;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.test.performance.Dimension;
 import org.eclipse.test.performance.PerformanceTestCase;
 import org.eclipse.ua.tests.help.util.LoadServletUtil;
@@ -27,13 +24,6 @@
 
 public class LowIterationHelpServerTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(LowIterationHelpServerTest.class);
-	}
-
 	@Override
 	protected void tearDown() throws Exception {
 		LoadServletUtil.stopServer();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
index 7103546..8d16c58 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/OpenHelpTest.java
@@ -13,9 +13,6 @@
  *******************************************************************************/
 package org.eclipse.ua.tests.help.performance;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.core.runtime.Platform;
 import org.eclipse.help.AbstractIndexProvider;
 import org.eclipse.help.AbstractTocProvider;
@@ -44,13 +41,6 @@
 	private AbstractIndexProvider[] indexProviders;
 	private Shell shell;
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(OpenHelpTest.class);
-	}
-
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();
diff --git a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
index 2367cd2..d7e20be 100644
--- a/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
+++ b/org.eclipse.ua.tests/help/org/eclipse/ua/tests/help/performance/TocAssemblePerformanceTest.java
@@ -30,18 +30,8 @@
 import org.eclipse.ua.tests.plugin.UserAssistanceTestPlugin;
 import org.xml.sax.SAXException;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 public class TocAssemblePerformanceTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(TocAssemblePerformanceTest.class);
-	}
-
 	private TocContribution parse(TocFileParser parser, String tocFile)
 			throws IOException, SAXException, ParserConfigurationException {
 		return parser.parse(new TocFile(UserAssistanceTestPlugin.getPluginId(), tocFile, true, "en", null, null));
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroPerformanceTests.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroPerformanceTests.java
index da3b354..6632e25 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroPerformanceTests.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/AllIntroPerformanceTests.java
@@ -14,26 +14,14 @@
 package org.eclipse.ua.tests.intro;
 
 import org.eclipse.ua.tests.intro.performance.OpenIntroTest;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
 
 /*
  * Tests help performance (automated).
  */
-public class AllIntroPerformanceTests extends TestSuite {
-
-	/*
-	 * Returns the entire test suite.
-	 */
-	public static Test suite() {
-		return new AllIntroPerformanceTests();
-	}
-
-	/*
-	 * Constructs a new performance test suite.
-	 */
-	public AllIntroPerformanceTests() {
-		addTest(OpenIntroTest.suite());
-	}
+@RunWith(Suite.class)
+@SuiteClasses({ OpenIntroTest.class })
+public class AllIntroPerformanceTests {
 }
diff --git a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
index 10a305d..f04dad2 100644
--- a/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
+++ b/org.eclipse.ua.tests/intro/org/eclipse/ua/tests/intro/performance/OpenIntroTest.java
@@ -24,18 +24,8 @@
 import org.eclipse.ui.intro.IIntroPart;
 import org.eclipse.ui.intro.config.CustomizableIntroPart;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 public class OpenIntroTest extends PerformanceTestCase {
 
-	/*
-	 * Returns an instance of this Test.
-	 */
-	public static Test suite() {
-		return new TestSuite(OpenIntroTest.class);
-	}
-
 	@Override
 	protected void setUp() throws Exception {
 		super.setUp();