Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Fusier2005-01-07 08:42:34 +0000
committerFrederic Fusier2005-01-07 08:42:34 +0000
commit5cb9f8ecd53559ff3c10df42a2bc3784ca7e7125 (patch)
tree874e9a1e6e84a33e372715251bbdf4ec9de389f7 /org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java
parent5e027a93b6cd062bdddcdfc7b987d6079bca2f1f (diff)
downloadeclipse.jdt.core-5cb9f8ecd53559ff3c10df42a2bc3784ca7e7125.tar.gz
eclipse.jdt.core-5cb9f8ecd53559ff3c10df42a2bc3784ca7e7125.tar.xz
eclipse.jdt.core-5cb9f8ecd53559ff3c10df42a2bc3784ca7e7125.zip
*** empty log message ***
Diffstat (limited to 'org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java')
-rw-r--r--org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java81
1 files changed, 81 insertions, 0 deletions
diff --git a/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java
new file mode 100644
index 0000000000..8ac1bb67f5
--- /dev/null
+++ b/org.eclipse.jdt.core.tests.compiler/src/org/eclipse/jdt/core/tests/compiler/regression/RunComparableTests.java
@@ -0,0 +1,81 @@
+/*******************************************************************************
+ * Copyright (c) 2000, 2004 IBM Corporation and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Common Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/cpl-v10.html
+ *
+ * Contributors:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.jdt.core.tests.compiler.regression;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.eclipse.jdt.core.tests.junit.extension.TestCase;
+import org.eclipse.jdt.core.tests.util.AbstractCompilerTest;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Run all compiler regression tests
+ */
+public class RunComparableTests extends junit.framework.TestCase {
+
+ public static ArrayList ALL_CLASSES = null;
+ static {
+ ALL_CLASSES = new ArrayList();
+ ALL_CLASSES.add(AutoBoxingTest.class);
+ ALL_CLASSES.add(Compliance_1_5.class);
+ ALL_CLASSES.add(GenericTypeTest.class);
+ ALL_CLASSES.add(ForeachStatementTest.class);
+ ALL_CLASSES.add(StaticImportTest.class);
+ ALL_CLASSES.add(VarargsTest.class);
+ ALL_CLASSES.add(EnumTest.class);
+ ALL_CLASSES.add(MethodVerifyTest.class);
+ ALL_CLASSES.add(AnnotationTest.class);
+ // Reset forgotten subsets tests
+ TestCase.TESTS_PREFIX = null;
+ TestCase.TESTS_NAMES = null;
+ TestCase.TESTS_NUMBERS= null;
+ TestCase.TESTS_RANGE = null;
+ }
+
+ public RunComparableTests(String testName) {
+ super(testName);
+ }
+
+ public static Test suite() {
+ TestSuite ts = new TestSuite(RunComparableTests.class.getName());
+ for (int i = 0, size=ALL_CLASSES.size(); i < size; i++) {
+ Class testClass = (Class) ALL_CLASSES.get(i);
+ try {
+ Method suiteMethod = testClass.getDeclaredMethod("suite", new Class[0]); //$NON-NLS-1$
+ Test suite = (Test)suiteMethod.invoke(null, new Object[0]);
+ ts.addTest(suite);
+ } catch (IllegalAccessException e) {
+ e.printStackTrace();
+ } catch (InvocationTargetException e) {
+ e.getTargetException().printStackTrace();
+ } catch (NoSuchMethodException e) {
+ e.printStackTrace();
+ }
+ }
+ return ts;
+ }
+
+ public static Test buildTestSuite(Class evaluationTestClass) {
+ TestSuite suite = new TestSuite(AbstractCompilerTest.COMPLIANCE_1_5);
+ List tests = TestCase.buildTestsList(evaluationTestClass);
+ for (int index=0, size=tests.size(); index<size; index++) {
+ suite.addTest((Test)tests.get(index));
+ }
+ TestSuite test = new TestSuite(evaluationTestClass.getName());
+ test.addTest(new RegressionTestSetup(suite, AbstractCompilerTest.COMPLIANCE_1_5));
+ return test;
+ }
+}

Back to the top