Bug 561040 - Migrate ant tests to JUnit 4
* Remove useless overrides just calling super.
* Convert APITests to POJO
Change-Id: Iff5a1606f698aefa2cead69238ca493e96e13e4e
Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/APITests.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/APITests.java
index 7569f2a..b3934b9 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/APITests.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/APITests.java
@@ -13,15 +13,14 @@
*******************************************************************************/
package org.eclipse.ant.tests.ui;
-import org.eclipse.ant.tests.ui.testplugin.AbstractAntUITest;
+import static org.junit.Assert.assertEquals;
+
import org.eclipse.jdt.core.JavaCore;
+import org.junit.Test;
-public class APITests extends AbstractAntUITest {
+public class APITests {
- public APITests(String name) {
- super(name);
- }
-
+ @Test
public void testCompareJavaVersions() {
String vmver = "1.6"; //$NON-NLS-1$
int comparison = JavaCore.compareJavaVersions(vmver, JavaCore.VERSION_1_7);
diff --git a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildTest.java b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildTest.java
index b2b2ff2..616f466 100644
--- a/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildTest.java
+++ b/ant/org.eclipse.ant.tests.ui/Ant Tests/org/eclipse/ant/tests/ui/AbstractAntUIBuildTest.java
@@ -34,7 +34,8 @@
}
/**
- * Runs the test and collects the result in a TestResult without blocking the UI thread.
+ * Runs the test and collects the result in a TestResult without blocking the UI
+ * thread.
*/
@Override
public void run(final TestResult result) {
@@ -48,8 +49,7 @@
};
thread = new Thread(r);
thread.start();
- }
- catch (Exception e) {
+ } catch (Exception e) {
e.printStackTrace();
}
@@ -57,30 +57,17 @@
try {
if (!display.readAndDispatch())
display.sleep();
- }
- catch (Throwable e) {
+ } catch (Throwable e) {
e.printStackTrace();
}
}
}
/**
- * Launches the Ant build with the buildfile name (no extension). Waits for all of the lines to be appended to the console.
- *
- * @param buildFileName
- * the buildfile to execute
- * @return thread in which the first suspend event occurred
- */
- @Override
- protected void launch(String buildFileName) throws CoreException {
- super.launch(buildFileName);
- }
-
- /**
- * Launches the launch configuration Waits for all of the lines to be appended to the console.
+ * Launches the launch configuration Waits for all of the lines to be appended
+ * to the console.
*
- * @param config
- * the config to execute
+ * @param config the config to execute
* @return thread in which the first suspend event occurred
*/
protected void launch(ILaunchConfiguration config) throws CoreException {
@@ -91,8 +78,4 @@
Display.getDefault().asyncExec(() -> link.linkActivated());
}
- @Override
- protected void launch(String buildFileName, String arguments) throws CoreException {
- super.launch(buildFileName, arguments);
- }
}