From c221d768ac73d56e3dcb7da6ca936198174f65db Mon Sep 17 00:00:00 2001 From: Marc-Andre Laperle Date: Thu, 13 Mar 2014 02:00:03 -0400 Subject: [PATCH] Always run CDescriptorTests methods in the same order It appears this class was not written to with random test ordering in mind. This should fix some of the intermittent test failures. Signed-off-by: Marc-Andre Laperle --- .../cdescriptor/tests/CDescriptorTests.java | 22 ++++++++++++++----- 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java index 648c7a5a0ac..ff48eb033ca 100644 --- a/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java +++ b/core/org.eclipse.cdt.core.tests/misc/org/eclipse/cdt/core/cdescriptor/tests/CDescriptorTests.java @@ -16,7 +16,6 @@ import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.Reader; -import java.lang.reflect.Method; import junit.extensions.TestSetup; import junit.framework.Test; @@ -64,11 +63,22 @@ public class CDescriptorTests extends BaseTestCase { public static Test suite() { TestSuite suite = new TestSuite(CDescriptorTests.class.getName()); - // Add all the tests in this class - for (Method m : CDescriptorTests.class.getMethods()) { - if (m.getName().startsWith("test")) - suite.addTest(new CDescriptorTests(m.getName())); - } + // Always run the tests in the same order because they were not written with random order in mind. + suite.addTest(new CDescriptorTests("testDescriptorCreation")); + suite.addTest(new CDescriptorTests("testDescriptorOwner")); + suite.addTest(new CDescriptorTests("testConcurrentDescriptorModification")); + suite.addTest(new CDescriptorTests("testConcurrentDifferentStorageElementModification")); + suite.addTest(new CDescriptorTests("testConcurrentSameStorageElementModification")); + suite.addTest(new CDescriptorTests("testDeadlockDuringProjectCreation")); + suite.addTest(new CDescriptorTests("testDescriptorConversion")); + suite.addTest(new CDescriptorTests("testExtensionCreation")); + suite.addTest(new CDescriptorTests("testExtensionGet")); + suite.addTest(new CDescriptorTests("testExtensionData")); + suite.addTest(new CDescriptorTests("testExtensionRemove")); + suite.addTest(new CDescriptorTests("testProjectDataCreate")); + suite.addTest(new CDescriptorTests("testProjectDataDelete")); + suite.addTest(new CDescriptorTests("testCProjectDescriptionDescriptorInteraction")); + suite.addTest(new CDescriptorTests("testAccumulatingBlankLinesInProjectData")); TestSetup wrapper = new TestSetup(suite) { @Override