Bug 558330 - Ant tests do not run in Gerrit

Cut the crap out of ant.test.ui. There is no need to create TestSuite
manually, JUnit 3.x handles that perfectly on its own.

Change-Id: Ib8c6df219329a8e7942d89d4f753b127aa7a34bd
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorContentOutlineTests.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorContentOutlineTests.java
index a2737ed..9a88438 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorContentOutlineTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorContentOutlineTests.java
@@ -25,9 +25,6 @@
 import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
 import org.eclipse.jface.text.BadLocationException;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 /**
  * Tests the correct creation of the outline for an xml file.
  * 
@@ -203,8 +200,4 @@
 		assertFalse("Target with description attribute should not be internal", model.getTargetNode("non-internal").isInternal()); //$NON-NLS-1$ //$NON-NLS-2$
 		assertFalse("Default target should not be internal", model.getTargetNode("-default").isInternal()); //$NON-NLS-1$ //$NON-NLS-2$
 	}
-
-	public static Test suite() {
-		return new TestSuite(AntEditorContentOutlineTests.class);
-	}
 }
\ No newline at end of file
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
index d015bcc..b7a0f58 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/AntEditorTests.java
@@ -299,7 +299,8 @@
 		assertNotNull(region);
 		IDocument doc = editor.getDocumentProvider().getDocument(editor.getEditorInput());
 		String text = doc.get(region.getOffset(), region.getLength());
-		assertTrue("Region incorrect. Expected length of 7 and text of \"compile\", length was " + region.getLength() + " and text was " + text, region.getLength() == 7 && "compile".equals(text)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+		assertTrue("Region incorrect. Expected length of 7 and text of \"compile\", length was " + region.getLength() + " and text was " //$NON-NLS-1$ //$NON-NLS-2$
+				+ text, region.getLength() == 7 && "compile".equals(text)); //$NON-NLS-1$
 	}
 
 	public void testOpenImport() throws PartInitException {
@@ -328,11 +329,6 @@
 		return offset;
 	}
 
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see junit.framework.TestCase#tearDown()
-	 */
 	@Override
 	protected void tearDown() throws Exception {
 		EditorTestHelper.closeAllEditors();
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
index 395511f..c2849fb 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/CodeCompletionTest.java
@@ -25,9 +25,6 @@
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.parsers.ParserConfigurationException;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.ant.core.AntCorePlugin;
 import org.eclipse.ant.core.AntCorePreferences;
 import org.eclipse.ant.core.Property;
@@ -63,10 +60,6 @@
 		super(name);
 	}
 
-	public static Test suite() {
-		return new TestSuite(CodeCompletionTest.class);
-	}
-
 	/**
 	 * Tests the code completion for attributes of tasks.
 	 */
@@ -83,8 +76,7 @@
 		String displayString = proposal.getDisplayString();
 		assertTrue(displayString.equals("id") //$NON-NLS-1$
 				|| displayString.equals("taskname") //$NON-NLS-1$
-				|| displayString.equals(IAntCoreConstants.DESCRIPTION)
-				|| displayString.equals(IAntCoreConstants.FILE)
+				|| displayString.equals(IAntCoreConstants.DESCRIPTION) || displayString.equals(IAntCoreConstants.FILE)
 				|| displayString.equals("preservelastmodified - (true | false | on | off | yes | no)") //$NON-NLS-1$
 				|| displayString.equals("tofile") //$NON-NLS-1$
 				|| displayString.equals("todir") //$NON-NLS-1$
@@ -231,8 +223,8 @@
 			processor.setCursorPosition(lineOffset + columnNumber);
 			ICompletionProposal[] proposals = processor.getPropertyProposals(getCurrentDocument(), "", lineOffset + columnNumber); //$NON-NLS-1$
 			assertTrue(proposals.length >= 3);
-			assertContains("eclipse.home", proposals); //contributed //$NON-NLS-1$
-			assertContains("property.ui.testing2", proposals); //contributed //$NON-NLS-1$
+			assertContains("eclipse.home", proposals); // contributed //$NON-NLS-1$
+			assertContains("property.ui.testing2", proposals); // contributed //$NON-NLS-1$
 			assertContains("test", proposals); //$NON-NLS-1$
 		}
 		finally {
@@ -265,7 +257,8 @@
 		processor.setLineNumber(lineNumber);
 		processor.setColumnNumber(columnNumber);
 		processor.setCursorPosition(lineOffset + columnNumber);
-		proposals = processor.getTargetAttributeValueProposals(getCurrentDocument(), getCurrentDocument().get(0, lineOffset + columnNumber), "", "depends"); //$NON-NLS-1$ //$NON-NLS-2$
+		proposals = processor.getTargetAttributeValueProposals(getCurrentDocument(), getCurrentDocument().get(0, lineOffset
+				+ columnNumber), "", "depends"); //$NON-NLS-1$ //$NON-NLS-2$
 		assertTrue(proposals.length == 7);
 		assertContains("main", proposals); //$NON-NLS-1$
 		// XXX why do we not want a valid proposal?
@@ -911,6 +904,7 @@
 		processor.setCursorPosition(lineOffset + columnNumber);
 		ICompletionProposal[] proposals = processor.getProposalsFromDocument(getCurrentDocument(), ""); //$NON-NLS-1$
 		// true false yes no on off
+		System.out.println("Proposals length:" + proposals.length); //$NON-NLS-1$
 		assertTrue(proposals.length == 6);
 		assertContains("true", proposals); //$NON-NLS-1$
 		assertContains("no", proposals); //$NON-NLS-1$
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/TaskDescriptionProviderTest.java b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/TaskDescriptionProviderTest.java
index 18af496..f21c0b8 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/TaskDescriptionProviderTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Editor Tests/org/eclipse/ant/tests/ui/editor/TaskDescriptionProviderTest.java
@@ -16,11 +16,8 @@
 
 package org.eclipse.ant.tests.ui.editor;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
 import org.eclipse.ant.internal.ui.editor.TaskDescriptionProvider;
+import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
 
 /**
  * Tests the tasks description provider.
@@ -62,7 +59,4 @@
 		assertEquals("yes", required); //$NON-NLS-1$
 	}
 
-	public static Test suite() {
-		return new TestSuite(TaskDescriptionProviderTest.class);
-	}
 }
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 684fbc5..77df87e 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
@@ -14,9 +14,6 @@
 
 package org.eclipse.ant.tests.ui.performance;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.ant.tests.ui.AbstractAntUIBuildPerformanceTest;
 import org.eclipse.core.externaltools.internal.IExternalToolConstants;
 import org.eclipse.core.runtime.CoreException;
@@ -31,10 +28,6 @@
 		super(name);
 	}
 
-	public static Test suite() {
-		return new TestSuite(SeparateVMTests.class);
-	}
-
 	/**
 	 * Performance test for launching Ant in a separate vm.
 	 */
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
index e2e9792..06c00c5 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/separateVM/SeparateVMTests.java
@@ -38,9 +38,6 @@
 import org.eclipse.swt.graphics.Color;
 import org.eclipse.ui.console.IHyperlink;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 public class SeparateVMTests extends AbstractAntUIBuildTest {
 
 	protected static final String PLUGIN_VERSION = "org.apache.ant_1.10.7"; //$NON-NLS-1$
@@ -49,10 +46,6 @@
 		super(name);
 	}
 
-	public static Test suite() {
-		return new TestSuite(SeparateVMTests.class);
-	}
-
 	/**
 	 * Checks that the expected line count has been reached and if not dump out what was tracked to System.err
 	 * 
diff --git a/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch b/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
index 5b6585f..e8490db 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
+++ b/ant/org.eclipse.ant.tests.ui/Ant UI Test Suite.launch
@@ -1,42 +1,42 @@
 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
 <launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
-<booleanAttribute key="append.args" value="true"/>
-<booleanAttribute key="askclear" value="false"/>
-<booleanAttribute key="automaticAdd" value="true"/>
-<booleanAttribute key="automaticValidate" value="false"/>
-<stringAttribute key="bootstrap" value=""/>
-<stringAttribute key="checked" value="[NONE]"/>
-<booleanAttribute key="clearConfig" value="true"/>
-<booleanAttribute key="clearws" value="true"/>
-<booleanAttribute key="clearwslog" value="false"/>
-<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
-<booleanAttribute key="default" value="true"/>
-<booleanAttribute key="includeOptional" value="true"/>
-<stringAttribute key="location" value="${workspace_loc}/../ant-junit-workspace"/>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
-<listEntry value="/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java"/>
-</listAttribute>
-<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
-<listEntry value="1"/>
-</listAttribute>
-<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
-<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
-<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
-<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
-<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
-<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
-<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.tests.ui.testplugin.AntUITests"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
-<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ant.tests.ui"/>
-<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx384m -XX:MaxPermSize=128M"/>
-<stringAttribute key="pde.version" value="3.3"/>
-<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
-<booleanAttribute key="run_in_ui_thread" value="true"/>
-<booleanAttribute key="show_selected_only" value="false"/>
-<booleanAttribute key="tracing" value="false"/>
-<booleanAttribute key="useCustomFeatures" value="false"/>
-<booleanAttribute key="useDefaultConfig" value="true"/>
-<booleanAttribute key="useDefaultConfigArea" value="false"/>
-<booleanAttribute key="useProduct" value="true"/>
+    <booleanAttribute key="append.args" value="true"/>
+    <booleanAttribute key="askclear" value="false"/>
+    <booleanAttribute key="automaticAdd" value="true"/>
+    <booleanAttribute key="automaticValidate" value="false"/>
+    <stringAttribute key="bootstrap" value=""/>
+    <stringAttribute key="checked" value="[NONE]"/>
+    <booleanAttribute key="clearConfig" value="true"/>
+    <booleanAttribute key="clearws" value="true"/>
+    <booleanAttribute key="clearwslog" value="false"/>
+    <stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+    <booleanAttribute key="default" value="true"/>
+    <booleanAttribute key="includeOptional" value="true"/>
+    <stringAttribute key="location" value="${workspace_loc}/../ant-junit-workspace"/>
+    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+        <listEntry value="/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java"/>
+    </listAttribute>
+    <listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+        <listEntry value="1"/>
+    </listAttribute>
+    <stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+    <booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+    <stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+    <stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+    <booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+    <stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+    <stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.ant.tests.ui.testplugin.AntUITests"/>
+    <stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+    <stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.ant.tests.ui"/>
+    <stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+    <stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xms40m -Xmx384m"/>
+    <stringAttribute key="pde.version" value="3.3"/>
+    <stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+    <booleanAttribute key="run_in_ui_thread" value="true"/>
+    <booleanAttribute key="show_selected_only" value="false"/>
+    <booleanAttribute key="tracing" value="false"/>
+    <booleanAttribute key="useCustomFeatures" value="false"/>
+    <booleanAttribute key="useDefaultConfig" value="true"/>
+    <booleanAttribute key="useDefaultConfigArea" value="false"/>
+    <booleanAttribute key="useProduct" value="true"/>
 </launchConfiguration>
diff --git a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUIPerformanceTests.java b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUIPerformanceTests.java
index e24ab59..8d3246f 100644
--- a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUIPerformanceTests.java
+++ b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUIPerformanceTests.java
@@ -14,12 +14,12 @@
 
 package org.eclipse.ant.tests.ui.testplugin;
 
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
 import org.eclipse.ant.tests.ui.editor.performance.OpenAntEditorTest;
 import org.eclipse.ant.tests.ui.performance.SeparateVMTests;
 
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 /**
  * Performance Test suite for the Ant UI. All of the tests in this suite rely on the setup that occurs in the ProjectCreationDecorator suite. It must
  * always run before any of the other test suites.
@@ -30,8 +30,8 @@
 
 		TestSuite suite = new AntUIPerformanceTests();
 		suite.setName("Ant UI Performance Unit Tests"); //$NON-NLS-1$
-		suite.addTest(new TestSuite(OpenAntEditorTest.class));
-		suite.addTest(new TestSuite(SeparateVMTests.class));
+		suite.addTestSuite(OpenAntEditorTest.class);
+		suite.addTestSuite(SeparateVMTests.class);
 		// suite.addTest(new TestSuite(NonInitialTypingTest.class));
 		// suite.addTest(new TestSuite(OpenLaunchConfigurationDialogTests.class));
 		return suite;
diff --git a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java
index 7268acf..d3eec14 100644
--- a/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java
+++ b/ant/org.eclipse.ant.tests.ui/test plugin/org/eclipse/ant/tests/ui/testplugin/AntUITests.java
@@ -52,28 +52,28 @@
 
 		TestSuite suite = new AntUITests();
 		suite.setName("Ant UI Unit Tests"); //$NON-NLS-1$
-		suite.addTest(new TestSuite(BuildTests.class));
-		suite.addTest(new TestSuite(SeparateVMTests.class));
-		suite.addTest(new TestSuite(AntEditorTests.class));
-		suite.addTest(new TestSuite(CodeCompletionTest.class));
-		suite.addTest(new TestSuite(TaskDescriptionProviderTest.class));
-		suite.addTest(new TestSuite(AntEditorContentOutlineTests.class));
-		suite.addTest(new TestSuite(MigrationTests.class));
-		suite.addTest(new TestSuite(BuilderCoreUtilsTests.class));
-		suite.addTest(new TestSuite(ModelProjectTests.class));
-		suite.addTest(new TestSuite(FormattingPreferencesTest.class));
-		suite.addTest(new TestSuite(XmlDocumentFormatterTest.class));
-		suite.addTest(new TestSuite(XmlTagFormatterTest.class));
-		suite.addTest(new TestSuite(XmlFormatterTest.class));
-		suite.addTest(new TestSuite(AntUtilTests.class));
-		suite.addTest(new TestSuite(AntViewTests.class));
-		suite.addTest(new TestSuite(BreakpointTests.class));
-		suite.addTest(new TestSuite(RunToLineTests.class));
-		suite.addTest(new TestSuite(SteppingTests.class));
-		suite.addTest(new TestSuite(PropertyTests.class));
-		suite.addTest(new TestSuite(OccurrencesFinderTests.class));
-		suite.addTest(new TestSuite(StackTests.class));
-		suite.addTest(new TestSuite(APITests.class));
+		suite.addTestSuite(BuildTests.class);
+		suite.addTestSuite(SeparateVMTests.class);
+		suite.addTestSuite(AntEditorTests.class);
+		suite.addTestSuite(CodeCompletionTest.class);
+		suite.addTestSuite(TaskDescriptionProviderTest.class);
+		suite.addTestSuite(AntEditorContentOutlineTests.class);
+		suite.addTestSuite(MigrationTests.class);
+		suite.addTestSuite(BuilderCoreUtilsTests.class);
+		suite.addTestSuite(ModelProjectTests.class);
+		suite.addTestSuite(FormattingPreferencesTest.class);
+		suite.addTestSuite(XmlDocumentFormatterTest.class);
+		suite.addTestSuite(XmlTagFormatterTest.class);
+		suite.addTestSuite(XmlFormatterTest.class);
+		suite.addTestSuite(AntUtilTests.class);
+		suite.addTestSuite(AntViewTests.class);
+		suite.addTestSuite(BreakpointTests.class);
+		suite.addTestSuite(RunToLineTests.class);
+		suite.addTestSuite(SteppingTests.class);
+		suite.addTestSuite(PropertyTests.class);
+		suite.addTestSuite(OccurrencesFinderTests.class);
+		suite.addTestSuite(StackTests.class);
+		suite.addTestSuite(APITests.class);
 		return suite;
 	}
 }